diff --git a/.gitignore b/.gitignore index b2e080cf73ee1e21d06317aaf88a08d336758e91..b7ea0073fe40a57ce53969cc6f415c4171ecacc8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ results *.pyc *.http .vscode/ -.idea +.venv diff --git a/.idea/runConfigurations/All_Unit_Tests.xml b/.idea/runConfigurations/All_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..8392a2e346bac9746136f3e2510b10c2b8600d5e --- /dev/null +++ b/.idea/runConfigurations/All_Unit_Tests.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/CheckTests_Unit_Tests.xml b/.idea/runConfigurations/CheckTests_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..92efef3e23df7c754201a721b3ebd78a22345c01 --- /dev/null +++ b/.idea/runConfigurations/CheckTests_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Check_Initial_Setup.xml b/.idea/runConfigurations/Check_Initial_Setup.xml new file mode 100644 index 0000000000000000000000000000000000000000..5ea679218eeb574a2da466e68505ee8f6f5d7ab5 --- /dev/null +++ b/.idea/runConfigurations/Check_Initial_Setup.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/CommonBehaviours_Unit_Tests.xml b/.idea/runConfigurations/CommonBehaviours_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..39ceab9ac051488783a17591b96bb5710bb848c0 --- /dev/null +++ b/.idea/runConfigurations/CommonBehaviours_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextInformation_Consumption_Unit_Tests.xml b/.idea/runConfigurations/ContextInformation_Consumption_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..64782d57805511ae96b24f2ecfd3794cb18d9ba7 --- /dev/null +++ b/.idea/runConfigurations/ContextInformation_Consumption_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextInformation_Provision_Unit_Tests.xml b/.idea/runConfigurations/ContextInformation_Provision_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..a414ee7543f5089dd513229820f70c51258a6887 --- /dev/null +++ b/.idea/runConfigurations/ContextInformation_Provision_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextInformation_Subscription_Unit_Tests.xml b/.idea/runConfigurations/ContextInformation_Subscription_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..964e7546101e0416c359b130eaa254b0a3e766e4 --- /dev/null +++ b/.idea/runConfigurations/ContextInformation_Subscription_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextSource_Discovery_Unit_Tests.xml b/.idea/runConfigurations/ContextSource_Discovery_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb3518ff38a09c24decc3a5fdd38d3d1105119ea --- /dev/null +++ b/.idea/runConfigurations/ContextSource_Discovery_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextSource_RegistrationSubscription_Unit_Tests.xml b/.idea/runConfigurations/ContextSource_RegistrationSubscription_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5d3135afb6e36e9282f963060f6fb6c5ef93b8a --- /dev/null +++ b/.idea/runConfigurations/ContextSource_RegistrationSubscription_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ContextSource_Registration_Unit_Tests.xml b/.idea/runConfigurations/ContextSource_Registration_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb32add137e1393afc3ae2b8a984afb28b3eea7a --- /dev/null +++ b/.idea/runConfigurations/ContextSource_Registration_Unit_Tests.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Generate_Documentation_Data.xml b/.idea/runConfigurations/Generate_Documentation_Data.xml new file mode 100644 index 0000000000000000000000000000000000000000..81f4330c4e2e73e23cd0da343cb48338c0c8dd06 --- /dev/null +++ b/.idea/runConfigurations/Generate_Documentation_Data.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run_Selected_Text.xml b/.idea/runConfigurations/Run_Selected_Text.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba07fcba51fc818e2ceceb4531c34c3d5558d628 --- /dev/null +++ b/.idea/runConfigurations/Run_Selected_Text.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Statistics_Documentation_Data.xml b/.idea/runConfigurations/Statistics_Documentation_Data.xml new file mode 100644 index 0000000000000000000000000000000000000000..7618ff677c35784eb0156b09ee31e0907080cdc7 --- /dev/null +++ b/.idea/runConfigurations/Statistics_Documentation_Data.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/README.md b/README.md index dccc04ae416a75f377c8c3d19161ecd0acf776e5..41dbfa996a51a58cd275d47c1c8e744980c65fc2 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ In order to install the ETSI NGSI-LD Test Suite, download the configuration scri - For MacOS and Ubuntu, download the following file: -```$ curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/windows11/scripts/configure.sh > configure.sh``` +```$ curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/scripts/configure.sh > configure.sh``` - For Windows, using Powershell download the following file (curl is an alias for Invoke-WebRequest in Powershell): -```> curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/windows11/scripts/configure.ps1 > configure.ps1``` +```> curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/scripts/configure.ps1 > configure.ps1``` - For MacOS and Ubuntu, be sure that you have the proper execution permissions of the file and the user is included in the sudoers group, then execute the following script: @@ -63,7 +63,7 @@ In the `resources/variables.py` file, configure the following parameters: - `url` : It is the url of the context broker which is to be tested (including the `/ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1). --`temporal_api_url` : This is the url of the GET temporal operation API, in case that a Context Broker splits +- `temporal_api_url` : This is the url of the GET temporal operation API, in case that a Context Broker splits this portion of the API (e.g., http://localhost:8080/ngsi-ld/v1). - `ngsild_test_suite_context` : This is the url of the default context used in the ETSI NGSI-LD requests (e.g., 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'). @@ -84,6 +84,18 @@ Docker host. ``` ifconfig docker0 | grep inet | awk '{print $2}' ``` and that IP is the one that you need to use for notification purposes. +Optionally, there are some extra variables that can be used during the generation of fail logs detail with the Listener +to automatically generate in the Context Broker GitHub the corresponding issue about the Test Cases that failed during +the execution of the Test Suites. In case that you cannot use this functionality, delete those variables from the file. +As an explanation of the process, the GitHub Issue will be created if there is no other issue in the repository with +the same name and the status of the issue is not closed. + +In order to create these issues, we are using the [GitHub REST API](https://docs.github.com/en/rest). For this purpose, +we are using the authentication process with a personal access token. The variables that we need are the following: +* `github_owner`: Your GitHub user account. +* `github_broker_repo` : The corresponding url of the Context Broker repository. +* `github_token` : Your personal access token. Please take a look to the GitHub documentation if you want to generate +your own [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). ## Execute the NGSI-LD Test Suite @@ -100,7 +112,7 @@ Now, you can launch the tests with the following command in MacOS or Linux: ```$ robot --outputdir ./results .``` -For Windows system, you can lauch the tests with the following command: +For Windows system, you can launch the tests with the following command: ```> robot --outputdir .\results .\TP\NGSI-LD``` @@ -146,8 +158,8 @@ Robot Framework. Our recommendations are: - Install [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server) -- Define as variable the path of the working directory. In Settings > Languages & Frameworks > Robot Framework (Project), -insert the following: `{"EXECDIR": "{path}/auth-test-suite"}` +- Define as variable the path of the working directory. In Settings > Languages & Frameworks > Robot Framework +(Project), insert the following: `{"EXECDIR": "{path}/auth-test-suite"}`. ### Run configurations (PyCharm) @@ -225,7 +237,18 @@ And, if you want to generate a documentation for the Test Cases: ```$ python3 -m robot.testdoc TP/NGSI-LD api_docs/TestCases.html``` -### Coding Style of Test Suites +## Generate output file details only for failed tests + +It is possible to generate a report only for the failed tests through the use of a specific listener in the execution +of the robot framework. For example, if we want to execute the test suite number 043 and generate the report, we can +execute the following command: + +```robot --listener libraries/ErrorListener.py --outputdir ./results ./TP/NGSI-LD/CommonBehaviours/043.robot``` + +It will generate a specific `errors.log` file into the `results` folder with the description of the different steps +developed and the mismatched observed on them. + +## Coding Style of Test Suites And if you want to tidy (code style) the Test Suites: diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot index 8a2bef47cc2fb4de682a013c8c2b6654e4be6c5e..abd654da978b3c0abc1eddee5da009b392e342cb 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot @@ -36,11 +36,14 @@ ${content_type}= application/json ... ${id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* + ${response}= Query Entity + ... id=${id} + ... context=${ngsild_test_suite_context} + ... accept=*/* Check Response Status Code 200 ${response.status_code} Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} - [Teardown] Delete Entity by Id Returning Response ${id} + [Teardown] Delete Entity by Id ${id} 045_01_02 Endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) @@ -48,7 +51,9 @@ ${content_type}= application/json ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Subscription ${id} accept=*/* + ${response}= Retrieve Subscription + ... id=${id} + ... accept=*/* Check Response Status Code 200 ${response.status_code} Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} @@ -77,9 +82,9 @@ ${content_type}= application/json [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} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${tea_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${response}= Query Temporal Representation Of Entities With Return ... entity_types=${teatype} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot index d7f08e66a05e5f16f1d79fc7b016c3cd2cbf15d9..14069952cd11493f02bf25f2c4b2c8033894ed55 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot @@ -54,9 +54,9 @@ ${registration_filename}= csourceRegistrations/context-source-registration [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} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${tea_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -79,7 +79,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Batch Delete Entities @{entities_ids_to_be_created} + [Teardown] Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_created} 043_01_05 Create context source registration [Documentation] Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot index c405da48846078ba717a24a55519990b2198faf9..5ee383661fe209c2447209e4695b486bdee1c544 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot @@ -2,7 +2,6 @@ Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -18,14 +17,14 @@ ${attribute_id}= brandName *** Test Cases *** -044_01_01 Endpoint /entities/{entityId}/attrs/{attrId} +044_01_01 endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] ea-partial-update 6_3_4 ${response}= Partial Update Entity Attributes - ... ${entity_id} - ... ${attribute_id} - ... ${vehicle_fragment} - ... ${CONTENT_TYPE_MERGE_PATCH_JSON} + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... fragment_filename=${vehicle_fragment} + ... content_type=${CONTENT_TYPE_MERGE_PATCH_JSON} ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response.status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot index c234fad7301ec25bf91e7b048d727619df11981c..38654ea2f5ab92a86c9d331aa95d75a725820bdd 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot @@ -23,15 +23,19 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: [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} - ${response}= Query Entity ${entity_id} accept=${accept} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${accept} Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id ${entity_id} 049_01_02 Endpoint get /subscriptions/{subscriptionId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Retrieve Subscription ${id} accept=${accept} + ${response}= Retrieve Subscription + ... id=${id} + ... accept=${accept} Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot index 2b5ac9bd003ee6fe7c37339ea351a2849374ad08..a3586c9a8788f996afd2f979d6668fd91124d421 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot @@ -19,9 +19,10 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: [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" (get /subscriptions/{subscriptionId}) [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Retrieve Subscription ${id} accept=${accept} + ${response}= Retrieve Subscription + ... id=${id} + ... accept=${accept} Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Subscription ${id} 049_02_02 Query temporal entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (get /temporal/entities) diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot index fbd9c87f7312808be977a9d17eca32f00dc804b6..d49ea02115a7750a804de81e136ca5b741fdb0ad 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot @@ -29,12 +29,12 @@ ${content_type}= application/xml [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Partial Update Entity Attributes - ... ${entity_id} - ... ${vehicle_attribute} - ... ${vehicle_fragment} - ... ${content_type} + ... entityId=${entity_id} + ... attributeId=${vehicle_attribute} + ... fragment_filename=${vehicle_fragment} + ... content_type=${content_type} Check Response Status Code 415 ${response.status_code} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id ${entity_id} 048_01_02 Endpoint patch /subscriptions/{subscriptionId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) @@ -74,15 +74,15 @@ ${content_type}= application/xml ${response}= Batch Create Entities @{entities_to_be_created} content_type=${content_type} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code 415 ${response.status_code} - [Teardown] Batch Delete Entities @{expected_entities_ids} + [Teardown] Batch Delete Entities entities_ids_to_be_deleted=@{expected_entities_ids} 048_01_06 Endpoint post /temporal/entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) [Tags] te-create 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${tea_filename} - ... ${content_type} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${tea_filename} + ... content_type=${content_type} Check Response Status Code 415 ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot index fae780feb2c1cd97772d8fcc2607b5871bea4760..49d35c1440f0461894368d230ba72e194f4be6f3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Suite Setup Setup Initial Entity +Suite Teardown Delete Initial Entity *** Variables *** @@ -28,7 +28,7 @@ ${filename}= building-simple-attributes-sample.json *** Keywords *** -Setup Initial Entities +Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ... ${filename} @@ -37,5 +37,5 @@ Setup Initial Entities ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} -Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot index 724d19cfa45173ce72f9253a2e41c3bc5468ad1b..14f30676b70c5d1441cc5632ffe7bf2410e7aaaa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Suite Setup Setup Initial Entity +Suite Teardown Delete Initial Entity *** Variables *** @@ -26,7 +26,7 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json *** Keywords *** -Setup Initial Entities +Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ... ${filename} @@ -35,5 +35,5 @@ Setup Initial Entities ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} -Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 78af98e634af4728d97c3df980636960de4e13f7..efd3a03089bfeae9b9a7b14d0fe25ef4e47a89e4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Entity +Test Teardown Delete Initial Entity Test Template Retrieve Available Attributes @@ -20,7 +20,8 @@ ${filename}= building-simple-attributes-sample.json 025_01_01 WithoutJsonLdContext [Tags] ed-attrs 5_7_8 ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json -025_01_02 WithJsonLdContext [Tags] ed-attrs 5_7_8 +025_01_02 WithJsonLdContext + [Tags] ed-attrs 5_7_8 ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json @@ -28,11 +29,12 @@ ${filename}= building-simple-attributes-sample.json Retrieve Available Attributes [Documentation] Check that you can retrieve a list of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - ${response}= Retrieve Attributes ${context} + ${response}= Retrieve Attributes + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing AttributeList element ${expectation_file} ${response.json()} -Setup Initial Entities +Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ... ${filename} @@ -41,5 +43,5 @@ Setup Initial Entities ... ${ngsild_test_suite_context} Set Test Variable ${entity_id} -Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot index c5e68d94f874d261a0dac746f7827aa1142057b7..6fc21b311e4a9b57926e952d624a17be9cece803 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot @@ -45,5 +45,5 @@ Setup Initial Entities Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot index 5af0f11602de52ad5612b275ad94ce67c84c81b1..f7414eec07121714443f27c2d3bb768aa7fc6d42 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot @@ -43,5 +43,5 @@ Setup Initial Entities Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${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 0210c83e76e3e2ffdf7361cc2ee10aa29ff8e685..c97a6e3e4cea8f67afa75c7c39c14801d834b3d3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -22,7 +22,8 @@ ${second_filename}= vehicle-simple-attributes-sample.json 022_01_01 WithoutJsonLdContext [Tags] ed-types 5_7_5 ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json -022_01_02 WithJsonLdContext [Tags] ed-types 5_7_5 +022_01_02 WithJsonLdContext + [Tags] ed-types 5_7_5 ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json @@ -30,7 +31,8 @@ ${second_filename}= vehicle-simple-attributes-sample.json Retrieve Available Entity Types [Documentation] Check that you can retrieve a list of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - ${response}= Retrieve Entity Types ${context} + ${response}= Retrieve Entity Types + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTypeList element ${expectation_file} ${response.json()} @@ -51,5 +53,5 @@ Setup Initial Entities Set Test Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${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 645b32b1f0dad2f8bb489dbcc1c1c0657fd9ffee..e7c1ef5e383add5436814f6aa3cf856571d85f30 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Entity +Test Teardown Delete Initial Entity Test Template Retrieve Details Of Available Attributes @@ -20,7 +20,8 @@ ${filename}= building-simple-attributes-sample.json 026_01_01 WithoutJsonLdContext [Tags] ed-attrs-details 5_7_9 ${EMPTY} types/expectations/attribute-026-01-01-expectation.json -026_01_02 WithJsonLdContext [Tags] ed-attrs-details 5_7_9 +026_01_02 WithJsonLdContext + [Tags] ed-attrs-details 5_7_9 ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json @@ -28,11 +29,13 @@ ${filename}= building-simple-attributes-sample.json Retrieve Details Of Available Attributes [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - ${response}= Retrieve Attributes context=${context} details=true + ${response}= Retrieve Attributes + ... context=${context} + ... details=true Check Response Status Code 200 ${response.status_code} Check Response Body Containing Attribute element ${expectation_file} ${response.json()} -Setup Initial Entities +Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ... ${filename} @@ -41,5 +44,5 @@ Setup Initial Entities ... ${ngsild_test_suite_context} Set Test Variable ${entity_id} -Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index 21e578f124f7dfcc9b2b13ed03d694bc830454cd..36ca2ee23cb6490803afc7febd1442ff626dd16e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -22,7 +22,8 @@ ${second_filename}= vehicle-simple-attributes-sample.json 023_01_01 WithoutJsonLdContext [Tags] ed-types-details 5_7_6 ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json -023_01_02 WithJsonLdContext [Tags] ed-types-details 5_7_6 +023_01_02 WithJsonLdContext + [Tags] ed-types-details 5_7_6 ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json @@ -30,7 +31,9 @@ ${second_filename}= vehicle-simple-attributes-sample.json Retrieve Details Of Available Entity Types [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - ${response}= Retrieve Entity Types context=${context} details=true + ${response}= Retrieve Entity Types + ... context=${context} + ... details=true Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityType element ${expectation_file} ${response.json()} @@ -51,5 +54,5 @@ Setup Initial Entities Set Test Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${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 1d4318b56ecac492efaa9f994a757fdeb135f850..20aaf6e6eb5914008e30a3bad3a4ebca36a144f2 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 @@ -22,25 +22,25 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${third_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response3}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response3.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -48,7 +48,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -56,6 +56,6 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by 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 fc35953289e945155c34f40ee52d699afb443243..762c8762024b6ec794d129ea1a88f3f1361f1cd9 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 @@ -28,38 +28,38 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${building_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${vehicle_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} Set Suite Variable ${parking_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response3}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response3.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} Check Response Body Containing List Containing Entity Elements With Different Types - ... ${expectation_filename} - ... ${entities_ids_to_be_compared} - ... ${response.json()} - ... ${True} + ... filename=${expectation_filename} + ... entities_representation_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} + ... ignore_core_context_version=${True} *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} - Delete Entity by Id Returning Response ${parking_entity_id} + Delete Entity by Id ${building_entity_id} + Delete Entity by Id ${vehicle_entity_id} + Delete Entity by 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 fcdcc2c8c4f11cc5537cb8d6d8b25108d391fbcf..d2ddcb4586cf0ad55314a6277b0cd5b487c40db8 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 @@ -23,31 +23,31 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements - ... ${expectation_filename} - ... ${entities_ids_to_be_compared} - ... ${response.json()} + Check Response Body Containing List Containing Entity Elements + ... expectation_filename=${expectation_filename} + ... entities_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 7d2987a864d9abbd5eda12f8d93f4513fc963d86..b151d9523f2c250326fbae79496ad0e68e3ed42b 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 @@ -25,18 +25,18 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename2} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} @@ -44,13 +44,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements - ... ${expectation_filename} - ... ${entities_ids_to_be_compared} - ... ${response.json()} - - Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -58,5 +52,5 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 c1bbe2382cc0c5e39763b76725a8f98a56227316..7191633102cc7b46e6203becea8de9dc9caff86d 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,5 +1,5 @@ *** Settings *** -Documentation Check that you can query entitites based on a geoquery +Documentation Check that you can query entities based on a geoquery Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource @@ -21,22 +21,22 @@ ${coordinates}= [13.3986, 52.5547] *** Test Cases *** 019_01_05 Query several entities based on a geoquery - [Documentation] Check that you can query entitites based on a geoquery + [Documentation] Check that you can query entities based on a geoquery [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -47,7 +47,7 @@ ${coordinates}= [13.3986, 52.5547] ... geometry=${geometry} ... coordinates=${coordinates} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -56,5 +56,5 @@ ${coordinates}= [13.3986, 52.5547] *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 8c8d91202183ba7eca189e141911d7a6e29b875d..18635a72eab39479da396e8dce66f2604e0f9a3a 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 @@ -26,7 +26,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... entity_id=${first_entity_id} ... entity_type=${entity_type} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -57,6 +57,6 @@ Create Entities Check Response Status Code 201 ${response.status_code} Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by 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 a55452e772d9274b02bf0d267daac23b47485009..f262652e6b544dbc138e12ea82a85f96210c6ed3 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 @@ -30,9 +30,9 @@ ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements With Different Types - ... ${expectation_filename} - ... ${entities_ids_to_be_compared} - ... ${response.json()} + ... filename=${expectation_filename} + ... entities_representation_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} ... ignore_core_context_version=True @@ -61,6 +61,6 @@ Create Entities Check Response Status Code 201 ${response.status_code} Delete Entities - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${first_vehicle_entity_id} - Delete Entity by Id Returning Response ${second_vehicle_entity_id} + Delete Entity by Id ${building_entity_id} + Delete Entity by Id ${first_vehicle_entity_id} + Delete Entity by Id ${second_vehicle_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 514238f25faf05bf0bf85e2e8c13ba187cfe4748..12f338967aa7f0974b253638f171c3480fcc0699 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 @@ -27,7 +27,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* ... entity_id_pattern=${entity_id_pattern} ... entity_type=${entity_type} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -51,5 +51,5 @@ Create Entities Check Response Status Code 201 ${response.status_code} Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 71e3d751dda9a0586118c5c38a9784bce0d034f8..913660a2cf8974727a9a0c2e7e930a1c8d5fc3a0 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 @@ -52,5 +52,5 @@ Create Entities Check Response Status Code 201 ${response.status_code} Delete Entities - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id ${building_entity_id} + Delete Entity by Id ${vehicle_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 7d9d89803792311857e3e8b539c705d56f1e3a0c..50e2dbc63bd067355aadc2553eacb127b225452d 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 @@ -22,7 +22,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** 019_02_05 Query several entities via POST Interaction asking for a GeoJSON representation - [Documentation] Check that you can query entitites via POST Interaction asking for a GeoJSON representation + [Documentation] Check that you can query entities via POST Interaction asking for a GeoJSON representation [Tags] e-query 5_7_2 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST @@ -53,5 +53,5 @@ Create Entities Check Response Status Code 201 ${response.status_code} Delete Entities - Delete Entity by Id Returning Response ${vehicle_entity_id} - Delete Entity by Id Returning Response ${parking_entity_id} + Delete Entity by Id ${vehicle_entity_id} + Delete Entity by Id ${parking_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 521efbd6c1da319a5ce534f9e9cf6e76af3cc16c..66e256598af0f54e12a279eb54ce89731069985c 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 @@ -23,18 +23,18 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities @@ -49,5 +49,5 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 d71679c9f9d956c5b07b3162ca2830fedfa61c14..563b5c0cfffa957e6e8e105eac617a554dc814cb 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 @@ -24,18 +24,18 @@ ${invalid_entity_type_two}= invalid_entity_type_two [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${building_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${vehicle_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${entity_types_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${invalid_entity_type_one} @@ -50,5 +50,5 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id ${building_entity_id} + Delete Entity by 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 c4f16c803cb65d39c596471b0d0e7043069b962b..1d0857cb2097cc0f9818db2be0393b4abcdfad34 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 @@ -22,18 +22,18 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern** [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_id_pattern=${invalid_entity_id_pattern} @@ -47,5 +47,5 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 8fb988e4c9f42ebdac4a0ca5c27fff39df09600c..7db8d213ddc4a2ca80858261d2611b6a69aa9120 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 @@ -23,18 +23,18 @@ ${invalid_attribute_two}= type [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 400 ${response.status_code} @@ -46,5 +46,5 @@ ${invalid_attribute_two}= type *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 b2454eeb2e9aae05645b22b840d875787ad49e0c..d89932a408643dc4e2032ed5802491aae94fa2b4 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,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot query entitites if the request has a wrong geometryProperty +Documentation Check that you cannot query entities if the request has a wrong geometryProperty Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource @@ -20,23 +20,23 @@ ${geoproperty}= location *** Test Cases *** -019_03_05 Query entitites when the request has a wrong geometryProperty - [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty +019_03_05 Query entities when the request has a wrong geometryProperty + [Documentation] Check that you cannot query entities if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} @@ -54,5 +54,5 @@ ${geoproperty}= location *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by 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 695bf2638e7ef4c9a0b3667641a984f0b65f4a6c..b729cb9588d5cf7017e1a1a999f4c9d3e79b484f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -23,25 +23,25 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${third_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response3}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response3.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -50,7 +50,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... entity_types=${entity_types_to_be_retrieved} ... options=${options_parameter} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} @@ -58,6 +58,6 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by 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 319f43221abd49ba334677ff2bd75ec26f55d4e0..a963fa843776b3739704ba89b8532a078d43c62d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -50,5 +50,5 @@ Create Initial Entities ... ${CONTENT_TYPE_LD_JSON} Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_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 f0a2128d5fa94e9ada5a7bf074516567020d8e65..9b7dc7ec121e440883cfde0f17407da9937a30c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -22,25 +22,25 @@ ${limit}= 2 [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${second_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response2.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${third_entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response3}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response3.status_code} ${entities_ids_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${first_entity_id} @@ -58,6 +58,6 @@ ${limit}= 2 *** Keywords *** Delete Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by 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 6b53f25ed816c7ef7453a02808e93abc797b2925..66970dfa1e148bbbdaf6fe64a2de7a87a59581ea 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 @@ -21,12 +21,14 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ... ${expectation_filename} @@ -37,4 +39,4 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Keywords *** Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 8475a7d91cb3807ec12a3fbb673ddb4c5ef9427a..c5c418be5894214c6896866fb0621e2f1aec71f7 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 @@ -23,18 +23,18 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} ${response}= Query Entity - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element @@ -46,4 +46,4 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Keywords *** Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${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 5476559a78425111b2e0f2f46d09598316c52589..2ec9c63d170a01291463b55e91873dbb35f108cb 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 @@ -22,14 +22,14 @@ ${geometry_property}= location [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} ${response}= Query Entity - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} ... geoproperty=${geometry_property} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element @@ -41,4 +41,4 @@ ${geometry_property}= location *** Keywords *** Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${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 6d74d271bfb3a3d405f34189d7beb1a194ae17a5..13067279be170c677086cc4b2aa7277516858ae0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -1,25 +1,25 @@ *** Settings *** -Documentation Check that you cannot get an entity with invalid/missing id +Documentation Check that you cannot get an entity with invalid id Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Get Entity With Invalid/Missing Id +Test Template Get Entity With Invalid 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 +018_02_01 Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** -Get Entity With Invalid/Missing Id +Get Entity With Invalid Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} 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 8e52018da3e9a330a8a369fb2678e130f4d1467c..c83b8661de9e42cc129bd1650ccd1a0f1689cbad 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -15,7 +15,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 0c6b697d395ddec1a73406ecc133fa018e0882de..a456aa68c619ee31b95099c16ad29f504e6cf04c 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 @@ -21,15 +21,15 @@ ${attribute_not_known}= property_not_found [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} ${response}= Query Entity - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to @@ -40,4 +40,4 @@ ${attribute_not_known}= property_not_found *** Keywords *** Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${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 840bf6c125c5f838ac1a243d2a16a6716b0e0330..370df415521b3f68716738bea1f82faed50dc473 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Created Entity +Test Teardown Delete Created Entity *** Variables *** @@ -21,15 +21,15 @@ ${options_parameter}= keyValues [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + Set Test Variable ${entity_id} + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} ${response}= Query Entity - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} ... options=${options_parameter} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element @@ -37,9 +37,8 @@ ${options_parameter}= keyValues ... ${entity_id} ... ${response.json()} ... ${True} - [Teardown] Delete Entity by Id Returning Response ${entity_id} *** Keywords *** Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${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 e2feff37a2982d3d21301937be465bebee031f42..a06f8909dfc038ec7ff28d43e9fd78f351888145 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -17,20 +17,21 @@ ${filename}= building-location-attribute-sample.jsonld *** Test Cases *** OPTIONS EXPECTATION_FILENAME -018_05_01_Simplified [Tags] e-retrieve 6_3_7 +018_05_01 Simplified + [Tags] e-retrieve 6_3_7 keyValues building-location-attribute-simplified.geojson -018_05_02_Normalized [Tags] e-retrieve 6_3_7 +018_05_02 Normalized + [Tags] e-retrieve 6_3_7 ${EMPTY} building-location-attribute-normalized.geojson *** Keywords *** Retrieve Entity In GeoJSON Representation [Documentation] Check that the queried entity by id can be returned in a GeoJSON format - [Tags] e-retrieve 6_3_7 [Arguments] ${options} ${expectation_filename} ${response}= Query Entity - ... ${entity_id} - ... ${CONTENT_TYPE_GEOJSON} + ... id=${entity_id} + ... accept=${CONTENT_TYPE_GEOJSON} ... options=${options} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} @@ -45,4 +46,4 @@ Create Initial Entity ... ${CONTENT_TYPE_LD_JSON} Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 7f95eafb096434b9439ae8846f3b6613347b1067..ffff142dd9643751738fd89fd337b692d3dcf77c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Setup Initial Entity Test Teardown Delete Created Entity -Test Template Check JSON-LD Resolution When retrieving an entity +Test Template Review JSON-LD Resolution When retrieving an entity *** Variables *** @@ -28,10 +28,13 @@ ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-co *** Keywords *** -Check JSON-LD Resolution When retrieving an entity +Review 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} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response.json()} @@ -45,4 +48,4 @@ Setup Initial Entity Set Test Variable ${entity_id} Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 4312f05d2db01bc98166b968e2ff5612c4367409..e7e0f174cf6fffbfdf5dfd4c4ff6599349256e20 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -20,21 +20,23 @@ ${bus_payload_file}= 2020-08-bus-temporal-representation-sample.j *** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -021_01_01 After [Tags] te-query 5_7_4 +021_01_01 After + [Tags] te-query 5_7_4 after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld -021_01_02 Before [Tags] te-query 5_7_4 +021_01_02 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 [Documentation] Check that you can query the temporal evolution of entities - [Arguments] ${timerel} ${timeAt} ${expectation_file} + [Arguments] ${timerel} ${timeat} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=${timerel} - ... timeAt=${timeAt} + ... timeAt=${timeat} ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index bb58c898eb498d34525370635a0dbfdc0a2c93c3..2ede1332dca4701f3296556c5efe7ad00644aeee 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -40,7 +40,7 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -52,6 +52,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 5e968f53fad19d3eaf10cf3711bb3e71656decc1..003a65943a8f24fa2b3a53310f64adcdc8fd10e9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -39,7 +39,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -51,6 +51,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 272bd6b9681766ec02fb499174a3e4d046954877..4ddd9113b75feb57802c3958fc012e90a987d259 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -38,7 +38,7 @@ ${expectation_file}= vehicles-temporal-representation-021-04-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -50,6 +50,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index a396969e2376685ebf9d49e89f955726045ea6f3..8ecc5c8326a6a487d59edf4998e0ee34e858cde5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -37,7 +37,7 @@ ${expectation_file}= vehicles-temporal-representation-021-05-expectation. *** Keywords *** -Setup Initial Entities +Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} @@ -45,6 +45,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 773a4a513ab29f2ad6abe1c710a4ae941f0a4657..90d282ed17b95fa48d2ed14ebb3d6f37c3e400c7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -38,7 +38,7 @@ ${expectation_file}= vehicles-temporal-representation-021-06-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -50,6 +50,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index 4536a564e6b5ea05f7880929f66ce3d4721fcb72..77e54de96a44275de4069e8a85a517f925d9e908 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -39,7 +39,7 @@ ${expectation_file}= vehicles-temporal-representation-021-07-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -51,6 +51,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index b5184ee5ded64ec0a7341caec75bdb21a3ae9f98..4e97c76f657f34dc72329e748c03f78207d41bed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Setup Initial Temporal Entities +Suite Teardown Delete Initial Temporal Entities *** Variables *** @@ -39,7 +39,7 @@ ${expectation_file}= vehicles-temporal-representation-021-08-expe *** Keywords *** -Setup Initial Entities +Setup Initial Temporal 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 @@ -51,6 +51,6 @@ Setup Initial Entities Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index e4f06bf7d7fc12ab635c3150ceab7d07648bd80a..64d4b253ea71a7e7d82da38dd775d6af7943c058 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Temporal Entities +Test Teardown Delete Initial Temporal Entities Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query @@ -19,9 +19,11 @@ ${expectation_file}= vehicles-temporal-representation-021-09-expe *** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE -021_09_01 Near Point [Tags] te-query 5_7_4 +021_09_01 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 -021_09_02 Within Polygon [Tags] te-query 5_7_4 +021_09_02 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 @@ -46,7 +48,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query ... ${temporal_entities_representation_ids} ... ${response.json()} -Setup Initial Entities +Setup Initial Temporal 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 @@ -58,6 +60,6 @@ Setup Initial Entities Set Test Variable ${first_temporal_entity_representation_id} Set Test Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index 21447857539d4542d8706f4f6dbb57ff9f784207..a9431ab7edfabca2d22b8efb59a28c1c31715906 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -7,8 +7,8 @@ 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 +Test Setup Create Initial Context Source Registration and Mock Server +Test Teardown Delete Initial Context Source Registration and Mock Server *** Variables *** @@ -33,7 +33,7 @@ ${context_source_url}= http://${context_source_ *** Keywords *** -Create Initial Context Source Registration +Create Initial Context Source Registration and Mock Server 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 @@ -42,6 +42,6 @@ Create Initial Context Source Registration Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} -Delete Initial Context Source Registration +Delete Initial Context Source Registration and Mock Server Stop Context Source Mock Server Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 5eedb04a7e58db4db7251a10ad335e0f15051aa5..1d35165e4fe91b79393bc843cdf94b087c2fb521 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Temporal Entities +Test Teardown Delete Initial Temporal Entities Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved @@ -40,7 +40,7 @@ Query the temporal evolution of entities with a limit to the number of entities Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Vehicle ${limit} ${response.json()} -Setup Initial Entities +Setup Initial Temporal 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} @@ -57,7 +57,7 @@ Setup Initial Entities Set Test Variable ${second_temporal_entity_representation_id} Set Test Variable ${third_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index b0d49427eda88cf3a2eecca10026ed690bbc7c65..ed4e91481981d23e132ba65c86840284e26c6421 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity *** Variables *** @@ -31,10 +31,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 21badc5b87a9b93c77945f9836b6b801ded5a385..b90c2fc6a8d0865f308cb4aeb2e5ad20c3f385e0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Temporal Entities +Test Teardown Delete Initial Temporal Entities Test Template Query the temporal evolution of entities using the entityOperations method @@ -18,9 +18,11 @@ ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sam *** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE -021_13_01 After [Tags] te-query 5_7_4 +021_13_01 After + [Tags] te-query 5_7_4 entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld -021_13_02 Before [Tags] te-query 5_7_4 +021_13_02 Before + [Tags] te-query 5_7_4 entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld @@ -29,7 +31,7 @@ Query the temporal evolution of entities using the entityOperations method [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method [Arguments] ${payload_file} ${expectation_file} ${response}= Query Temporal Representation Of Entities Via Post - ... ${payload_file} + ... query_file_name=${payload_file} ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} @@ -40,7 +42,7 @@ Query the temporal evolution of entities using the entityOperations method ... ${temporal_entities_representation_ids} ... ${response.json()} -Setup Initial Entities +Setup Initial Temporal 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 @@ -52,6 +54,6 @@ Setup Initial Entities Set Test Variable ${first_temporal_entity_representation_id} Set Test Variable ${second_temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 2f9e4ed8a07a6aac20b0e15882d7ca54fd265e2c..4fc7fb120868fc1b8f679becd58bada264f5e6e7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity *** Variables *** @@ -20,7 +20,8 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati 020_01_01 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 - ${response}= Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} @@ -29,10 +30,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index f1dfebf3980b565a7ee1299b6878828d2f353024..359e26e05614034149298682ff7fc1f6782e10ab 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity *** Variables *** @@ -21,7 +21,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] te-retrieve 5_7_3 ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element @@ -31,10 +31,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index fff9a67bc646c3980cb217e61de5c4882f17e095..74f48620c9fec779cbb20d842b7f3f98a02d969f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Create Temporal Entity +Test Teardown Delete Initial Temporal Entity *** Variables *** @@ -22,7 +22,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectati [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... attrs=${temporal_attributes_to_be_retrieved} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} @@ -33,10 +33,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectati *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 63ded0eee86a440ddd4ba735070c8cb106f3a8cf..4b7be9bb42b4e3af122ccedffeab3cddb27f88ee 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Create Temporal Entity +Test Teardown Delete Initial Temporal Entity Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query @@ -17,23 +17,26 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -020_04_01 After [Tags] te-retrieve 5_7_3 +020_04_01 After + [Tags] te-retrieve 5_7_3 after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld -020_04_02 Before [Tags] te-retrieve 5_7_3 +020_04_02 Before + [Tags] te-retrieve 5_7_3 before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld -020_04_03 Between [Tags] te-retrieve 5_7_3 +020_04_03 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 *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} + [Arguments] ${timerel} ${timeat} ${endtimeat} ${vehicle_expectation_file} ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... timerel=${timerel} - ... timeAt=${timeAt} - ... endTimeAt=${endTimeAt} + ... timeAt=${timeat} + ... endTimeAt=${endtimeat} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element @@ -41,10 +44,10 @@ Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal ... ${temporal_entity_representation_id} ... ${response.json()} -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Test Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 841b1c1059b81bdc345fcbc938047e0b6aa07caa..6e18ef8247c40603d41f3fb39d73a3d761de2c10 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Create Temporal Entity +Test Teardown Delete Initial Temporal Entity Test Template Retrieve the temporal evolution of the last N instances of entity attributes @@ -28,10 +28,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-in *** Keywords *** Retrieve the temporal evolution of the last N instances of entity attributes [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes - [Arguments] ${lastN} ${vehicle_expectation_file} + [Arguments] ${lastn} ${vehicle_expectation_file} ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} - ... lastN=${lastN} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... lastN=${lastn} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element @@ -39,10 +39,10 @@ Retrieve the temporal evolution of the last N instances of entity attributes ... ${temporal_entity_representation_id} ... ${response.json()} -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Test Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 34b4d56ff66ce45056b47ca45bbcf9bb41640246..1bf372e62a33a468ec9262a90c85fa9ed208ebd1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -10,7 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource 020_06_01 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 - ${response}= Retrieve Temporal Representation Of Entity invalidUri + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=invalidUri Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 29602d2ea202ab7530f03bc2e13629fa4ca400a5..7983fff02d3347f60c47a2489fdb36155cffc079 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -10,7 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource 020_07_01 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 - ${response}= Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=urn:ngsi-ld:Vehicle:unknowEntity Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 4ebe556a1c1c70a0876360d93862b12c753c8c24..411ea56bf3040ea64a7a7ff6804793d4193c53e9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity *** Variables *** @@ -21,7 +21,7 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... attrs=${temporal_attributes_to_be_retrieved} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} @@ -32,10 +32,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index d3f13d04a5ad6456c8e572396e7573bd8231d54e..466b418158083bff789203468534c3ff481dc192 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Create Temporal Entity +Test Teardown Delete Initial Temporal Entity Test Template Retrieve the temporal evolution of an entity with an invalid request content @@ -17,33 +17,36 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT -020_09_01 After [Tags] te-retrieve 5_7_3 +020_09_01 After + [Tags] te-retrieve 5_7_3 after ${EMPTY} ${EMPTY} -020_09_02 Before [Tags] te-retrieve 5_7_3 +020_09_02 Before + [Tags] te-retrieve 5_7_3 before ${EMPTY} ${EMPTY} -020_09_03 Between [Tags] te-retrieve 5_7_3 +020_09_03 Between + [Tags] te-retrieve 5_7_3 between 2020-08-01T12:00:00Z ${EMPTY} *** Keywords *** Retrieve the temporal evolution of an entity with an invalid request content [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content - [Arguments] ${timerel} ${timeAt} ${endTimeAt} + [Arguments] ${timerel} ${timeat} ${endtimeat} ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... timerel=${timerel} - ... timeAt=${timeAt} - ... endTimeAt=${endTimeAt} + ... timeAt=${timeat} + ... endTimeAt=${endtimeat} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Test Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index cedc13c57eb4fca3c0a512bd90c6a1097c060c43..17298e7035bbf1f5c5fc14abd278074b0b4c9942 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity *** Variables *** @@ -22,7 +22,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectati [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... options=${options} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} @@ -33,10 +33,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectati *** Keywords *** -Setup Initial Entities +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -Delete Initial Entities +Delete Initial Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 7137fe34b9762daf5f13891c7d1cb9cbbd8f47a5..477e7f9012c761912604c1bf184825e083e50ebf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -38,18 +38,23 @@ Batch Create Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - ${response}= Batch Create Entities @{entities_to_be_created} + ${response}= Batch Create Entities + ... @{entities_to_be_created} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Set Test Variable @{expected_entities_ids} ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} - ${response}= Query Entities - ... ${entities_to_be_queried} - ... Building + + ${response1}= Query Entities + ... entity_ids=${entities_to_be_queried} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Created Resources Set To ${entities_to_be_created} ${response.json()} + Check Created Resources Set To + ... expected_resources=${entities_to_be_created} + ... response_body=${response1.json()} Delete Initial Entities - Batch Delete Entities @{expected_entities_ids} + Batch Delete Entities entities_ids_to_be_deleted=@{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 11ff31a87c7a387f0cabd969e3f0bed2187b20eb..5a23e2ecae9d4dc8abd979d46d51763aabf6d209 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Suite Setup Setup Initial Entity Suite Teardown Delete Initial Entities @@ -36,21 +36,21 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - ${response}= Query Entities - ... ${expected_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=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} ${response.json()} + Check Created Resources Set To ${created_entities} ${response1.json()} *** Keywords *** -Setup Initial Entities +Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} 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 2c62a23045c3d900c8537ca9b25d80917f1b00e8..c2a6b4c2e6390cedc1d2d303830608830c3d297b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -8,9 +8,11 @@ Test Template Create Batch Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -003_03_01 InvalidJson [Tags] be-create 5_6_7 +003_03_01 InvalidJson + [Tags] be-create 5_6_7 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -003_03_02 EmptyJson [Tags] be-create 5_6_7 +003_03_01 EmptyJson + [Tags] be-create 5_6_7 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 84df0cc2aa765e1422aaa3af53f418753b2ef897..b7551d9fcc58cc0116f4364d98916ec0c46990f7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variables *** @@ -14,11 +14,12 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** -003_04_01 Create a batch of one entity using a provided Link header with JSON content type +003_04_01 Create a batch of one entity using a provided Link header with JSON content type and retrieve the entity with context detail [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @@ -26,17 +27,38 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ... content_type=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + + ${response1}= Retrieve Entity by Id + ... 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 ${response.json()} - ${response}= Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +003_04_02 Create a batch of one entity using a provided Link header with JSON content type and retrieve the entity without context detail + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] be-create 6_3_5 + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities + ... @{entities_to_be_created} + ... content_type=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + + ${response1}= Retrieve Entity by Id + ... id=${entity_id} # Attribute should not be compacted as we did not provide a context containing this attribute Check Response Body Containing an Attribute set to - ... https://ngsi-ld-test-suite/context#almostFull - ... ${response.json()} + ... expected_attribute_name=https://ngsi-ld-test-suite/context#almostFull + ... response_body=${response1.json()} *** Keywords *** Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 7c0e97560b25aeab97474c7e1f67dd8274d54d72..b1d934a73d399494fd3f9d238e6eeb1e8f33ef90 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variables *** @@ -15,23 +15,41 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** 003_05_01 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 + [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 and retrieve the entity without context [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Entity by Id ${entity_id} + + ${response1}= Retrieve Entity by Id id=${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull ${response.json()} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +003_05_02 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 and retrieve the entity with context + [Tags] be-create 6_3_5 + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response.status_code} + + ${response1}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull ${response.json()} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=ngsi-ld:default-context/almostFull + ... response_body=${response1.json()} *** Keywords *** Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index c54e731a6e965388ec52516ccc2573700d11ffaf..d48a743724f5868344457c30a6b76ee50723788b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variables *** @@ -15,25 +15,41 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** 003_07_01 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" + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" and the response attribute should be compacted as we used the same context as provided when creating the entity [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response1}= Retrieve Entity by Id + ... 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 ${response.json()} - ${response}= Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +003_07_02 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" and response attribute should not be compacted as we did not provide a context containing this term + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to - ... https://ngsi-ld-test-suite/context#almostFull - ... ${response.json()} + ... expected_attribute_name=https://ngsi-ld-test-suite/context#almostFull + ... response_body=${response1.json()} *** Keywords *** Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities + ... entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index dc6348ca6464a8228f7609fc70b72cd34c327c54..fa8104d981c5ca59243b28baded128fe81afee50 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities *** Variables *** @@ -17,12 +17,15 @@ ${building_id_prefix}= urn:ngsi-ld:Building: 006_01_01 Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] be-delete 5_6_10 - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} Check Response Status Code 204 ${response.status_code} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} - ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check SUT Not Containing Resources ${response.json()} + ${response1}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Building + ... context=${ngsild_test_suite_context} + Check SUT Not Containing Resources ${response1.json()} *** Keywords *** @@ -31,5 +34,5 @@ Setup Initial Entities ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Set Test Variable ${entities_ids_to_be_deleted} 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 d1283afb8d44883c0b9e0012187792e1ed871a97..c532ce2a6dd7aefdc82f62cc682382da40a60877 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entity *** Variables *** @@ -19,21 +19,28 @@ ${building_id_prefix}= urn:ngsi-ld:Building: [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} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + + ${response}= Batch Delete Entities entities_ids_to_be_deleted=@{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 + Set Test Variable ${expected_successful_entities_ids} + + &{response1}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} + Check Response Body Containing Batch Operation Result ${response1} ${response.json()} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check SUT Not Containing Resources ${response.json()} + ${response2}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Building + ... context=${ngsild_test_suite_context} + Check SUT Not Containing Resources ${response2.json()} *** Keywords *** -Setup Initial Entities +Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} - Set Suite Variable ${existing_entity_id} + Set Test Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index fc0e63fb3cf9cce916eff7b98e001b46e6f86c7d..9b9d913adc09e5ad8242a9d90f0279fb637ba313 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -8,9 +8,11 @@ Test Template Batch Delete Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -006_03_01 InvalidJson [Tags] be-delete 5_6_10 +006_03_01 InvalidJson + [Tags] be-delete 5_6_10 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -006_03_02 EmptyJson [Tags] be-delete 5_6_10 +006_03_02 EmptyJson + [Tags] be-delete 5_6_10 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 d1cd73ed9d077858a0308119a9cdb2448736804d..01350e4aab3f1d92a55af6cc77cbc25847d7110d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -45,12 +45,12 @@ 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} - ${response}= Query Entities - ... ${expected_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} ${response.json()} + Check Updated Resources Set To ${updated_entities} ${response1.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -62,4 +62,4 @@ Setup Initial Entities Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 851fe9755c0e6208f02b1429661b9959363e15be..20d9603ee26899e3f40fe06723d9099fbdadd37a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -17,15 +17,15 @@ ${entity_payload_filename}= building-simple-attributes-sample.jsonld *** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS -005_02_01 EntityWithSimpleProperties +005_02_01 EntityWithExistingAttributes [Tags] be-update 5_6_9 - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 -005_02_02 EntityWithSimpleRelationships + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 204 +005_02_02 EntityWithNewAttribute [Tags] be-update 5_6_9 building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 -005_02_03 EntityWithRelationshipsProperties +005_02_03 EntityWithNewAndExistingAttribute [Tags] be-update 5_6_9 - building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 + building-location-attribute-sample.jsonld fragmentEntities/location-fragment.json 204 *** Keywords *** @@ -45,12 +45,12 @@ 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} - ${response}= Query Entities - ... ${expected_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} ${response.json()} + Check Updated Resources Set To ${updated_entities} ${response1.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -62,4 +62,4 @@ Setup Initial Entities Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 6fe66f111e31981aa22a7a1d8f967d74a8d4e3c7..3e22a340ad9ad3e907673a4446400264771ad7d1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -29,6 +29,7 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- ${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} + ${response}= Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} Set Suite Variable @{expected_successful_entities_ids} @@ -38,6 +39,7 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} ${second_created_entity}= Load Test Sample ... entities/${entity_payload_filename} @@ -47,12 +49,13 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- ${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} - ${response}= Query Entities - ... ${expected_entities_ids} - ... Building + + ${response1}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} ${response.json()} + Check Updated Resources Set To ${updated_entities} ${response1.json()} *** Keywords *** @@ -65,4 +68,4 @@ Setup Initial Entities Set Suite Variable ${second_existing_entity_id} Delete Initial Entities - Batch Delete Entities @{expected_successful_entities_ids} + Batch Delete Entities entities_ids_to_be_deleted=@{expected_successful_entities_ids} 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 f386af46c461ef9c438e4d85dffd42c4527e4828..cd78f72beaa9b1c43c1b0db5484a793a8310900a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -8,9 +8,11 @@ Test Template Batch Update Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -005_04_01 InvalidJson [Tags] be-update 5_6_9 +005_04_01 InvalidJson + [Tags] be-update 5_6_9 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -005_04_02 InvalidJsonLd [Tags] be-update 5_6_9 +005_04_02 InvalidJsonLd + [Tags] be-update 5_6_9 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 78f968fdc029a25e86467ffdb960faa99572e926..575f1c52b2525969de97660d369e8e22992f2db5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -41,13 +41,12 @@ Batch Upsert Entity Scenarios Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - ${response}= Query Entities - ... ${expected_updated_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} - ${response}= Batch Delete Entities @{expected_entities_ids} + Check Updated Resources Set To ${entities_to_be_upserted} ${response1.json()} Delete Initial Entities - Batch Delete Entities @{expected_entities_ids} + Batch Delete Entities entities_ids_to_be_deleted=@{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 d6a900983a7245e0a778bc8486c834bbfa0b3042..c0f99081f494820b1076787c1177808ec9b2298f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -6,7 +6,6 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. 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 @@ -31,15 +30,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Batch Upsert Non-existing And Existing Entities Scenarios [Documentation] Check that you can upsert a batch of non-existing and existing entities [Arguments] ${filename} - ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Test Variable ${new_entity_id} - ${new_entity}= Load Entity ${filename} ${new_entity_id} - ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} - ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} - @{entities_to_be_upserted}= Create List - ... ${new_entity} - ... ${first_existing_entity} - ... ${second_existing_entity} + Setup Initial Entities ${filename} ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code 201 ${response.status_code} @@ -49,23 +40,35 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... ${first_existing_entity_id} ... ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - ${response}= Query Entities - ... ${expected_updated_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} + Check Updated Resources Set To ${entities_to_be_upserted} ${response1.json()} Setup Initial Entities + [Arguments] ${filename} ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} Set Test Variable ${first_existing_entity_id} Set Test Variable ${second_existing_entity_id} + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${new_entity_id} + ${new_entity}= Load Entity ${filename} ${new_entity_id} + ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} + ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} + @{entities_to_be_upserted}= Create List + ... ${new_entity} + ... ${first_existing_entity} + ... ${second_existing_entity} + Set Test Variable ${entities_to_be_upserted} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + @{entities_ids_to_be_deleted}= Create List + ... ${first_existing_entity_id} + ... ${second_existing_entity_id} + ... ${new_entity_id} + Batch Delete Entities entities_ids_to_be_deleted=@{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 9a55de5a0813ac0fadbe997137464545a6aed240..cd69a975d7c60bb9e8ff5754f9d938155d631b02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -38,12 +38,12 @@ Batch Upsert Existing Entities Scenarios Check Response Status Code 204 ${response.status_code} @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - ${response}= Query Entities - ... ${expected_updated_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} + Check Updated Resources Set To ${entities_to_be_upserted} ${response1.json()} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -55,4 +55,4 @@ Setup Initial Entities Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 19cec4f18bbcd6be19a83e7ce21d87640e070b2d..373c711cdfe0d75120fe69d29103a8666c85d157 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities +Test Setup Setup Initial Entity Test Teardown Delete Initial Entities Test Template Batch Upsert Entities With Update Option Scenarios @@ -47,20 +47,20 @@ 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} - ${response}= Query Entities - ... ${expected_updated_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} ${response.json()} + Check Updated Resources Set To ${updated_entities} ${response1.json()} -Setup Initial Entities +Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${existing_entity_payload_filename} ${existing_entity_id} Set Test Variable ${existing_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Batch Delete Entities entities_ids_to_be_deleted=@{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 e377284e514349870e9dcb9a45fb69abb482057f..d3261d04704aae9c1f1ef030f3f81ae900a69a08 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -25,18 +27,24 @@ ${building_id_prefix}= urn:ngsi-ld:Building: @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Set Test Variable ${expected_successful_entities_ids} @{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} + ... success=${expected_successful_entities_ids} + ... errors=${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - ${response}= Query Entities - ... ${expected_updated_entities_ids} - ... Building + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=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} ${response.json()} - ${response}= Batch Delete Entities @{expected_successful_entities_ids} + Check Updated Resources Set To ${upserted_entities} ${response1.json()} + + +*** Keywords *** +Delete Entities + ${response}= Batch Delete Entities + ... entities_ids_to_be_deleted=@{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 a5476c557f87fc8ba3fc378f9dd54edd42e21df1..94aa31b9386cff2fe473c0da1d9c9a3feb4eaf71 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -8,9 +8,11 @@ Test Template Batch Upsert Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -004_06_01 InvalidJson [Tags] be-upsert 5_6_8 +004_06_01 InvalidJson + [Tags] be-upsert 5_6_8 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -004_06_02 InvalidJsonLd [Tags] be-upsert 5_6_8 +004_06_02 InvalidJsonLd + [Tags] be-upsert 5_6_8 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 26bda50b4ea9d05e7f57e653e9220b023e69fe1d..140e388790114a47e8f616d019f50eb13c5faf4a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -42,16 +42,20 @@ Create Entity Scenarios Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${entity_id} ${response.headers} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} - IF '${content_type}'=='application/json' - ${response}= Retrieve Entity by Id ${entity_id} ${content_type} + IF '${content_type}' == 'application/json' + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... accept=${content_type} END - IF '${content_type}'=='application/ld+json' - ${response}= Retrieve Entity by Id - ... ${entity_id} - ... ${content_type} + IF '${content_type}' == 'application/ld+json' + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... accept=${content_type} ... context=${ngsild_test_suite_context} END - Check Created Resource Set To ${created_entity} ${response.json()} + Check Created Resource Set To + ... created_resource=${created_entity} + ... response_body=${response1.json()} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index 41698e6d482bd2b76602dfd4d69a5d01513f89a1..c1481b6130455039748caf28a01e3d7ef222c08a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -25,15 +25,15 @@ ${content_type}= application/ld+json ... ${entity_id} ... ${content_type} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity Selecting Content Type + ${response1}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 409 ${response.status_code} + Check Response Status Code 409 ${response1.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} + ... ${response1.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response1.json()} *** Keywords *** 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 c4bedd2eabeea114626cdbb099e3444f667cf121..d212101b49470cd560ccb29a4367fa173ab1f5b9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -13,21 +15,39 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** -001_04_01 Create one entity using a provided Link header with JSON content type +001_04_01 Create one entity using a provided Link header with JSON content type and NGSILD context [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response1}= Retrieve Entity by Id 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 ${response.json()} - ${response}= Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +001_04_02 Create one entity using a provided Link header with JSON content type and no context + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + ${response1}= Retrieve Entity by Id id=${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to - ... https://ngsi-ld-test-suite/context#almostFull - ... ${response.json()} - ${response}= Delete Entity by Id ${entity_id} + ... expected_attribute_name=https://ngsi-ld-test-suite/context#almostFull + ... response_body=${response1.json()} + + +*** Keywords *** +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index e2b54c1c18d57bb948a970a7135790cc9ef019f0..6105b77a101a73525af9a2b3110b01289ef75538 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -13,18 +15,34 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** -001_05_01 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 +001_05_01 Create one entity using the default context with JSON content type and request without context + [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, requesting without context [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} - ${response}= Retrieve Entity by Id ${entity_id} + ${response1}= Retrieve Entity by Id id=${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull ${response.json()} - ${response}= Retrieve Entity by Id - ... ${entity_id} - ... ${CONTENT_TYPE_JSON} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +001_05_02 Create one entity using the default context with JSON content type and request with context + [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, requesting with context + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull ${response.json()} - ${response}= Delete Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=ngsi-ld:default-context/almostFull + ... response_body=${response1.json()} + + +*** Keywords *** +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index 93f8139a6c25b0a83bc2d1e3386eb7c72dc49b70..09805dcefb86586c519d5d06a60b9fd0c15a166a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -13,17 +15,31 @@ ${filename}= building-simple-attributes-sample.jsonld *** Test Cases *** -001_07_01 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" +001_07_01 Create one entity using a JSON-LD @context obtained from the request payload with ld context + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" and retrieve with ld context [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response1}= Retrieve Entity by Id 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 ${response.json()} - ${response}= Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=almostFull + ... response_body=${response1.json()} + +001_07_02 Create one entity using a JSON-LD @context obtained from the request payload without context + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" and retrieve without context + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response1}= Retrieve Entity by Id id=${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to - ... https://ngsi-ld-test-suite/context#almostFull - ... ${response.json()} - ${response}= Delete Entity by Id ${entity_id} + ... expected_attribute_name=https://ngsi-ld-test-suite/context#almostFull + ... response_body=${response1.json()} + + +*** Keywords *** +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index ed6189dacc5b0d60c47fe6cf8e20f3b1170b8390..0746a6a2efe6ed3c7c6da4604e2abdd996d1cb8e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -21,7 +21,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ... ${entity_id} ... application/ld+json Check Response Status Code 201 ${response.status_code} - ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource ${response.status_code} + ${response1}= Delete Entity by Id ${entity_id} + Check Response Status Code 204 ${response1.status_code} + ${response2}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource ${response2.status_code} 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 20080e5346df8715cff9c6eec1dd281441e86bea..7822ceae3003f0f9f9cde1f1b4397405ad38001a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -11,7 +11,7 @@ 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 [Tags] e-delete 5_6_6 - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + ${EMPTY} 405 ${EMPTY} 002_02_02 Delete an entity if the Entity Id is not a valid URI [Tags] e-delete 5_6_6 thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} @@ -21,9 +21,11 @@ Test Template Delete Entity Scenarios Delete Entity Scenarios [Documentation] Check that you cannot delete an entity with invalid/missing id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - ${response}= Delete Entity by Id Returning Response ${entity_id} + ${response}= Delete Entity by Id ${entity_id} Check Response Status Code ${expected_status_code} ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END 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 8a17c0240635fae19094e3162d108dc47adace84..e057e68e7bcbb38b466b53c3652deffd5d6cdfd1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -16,7 +16,7 @@ ${expected_status_code}= 404 [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} + ${response}= Delete Entity by Id ${entity_id} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index bc4d06e0c1001d512351bff9378b36d84f14ef87..c419292697d3747029ada8cb4b6bc78373c013eb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -6,38 +6,21 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity +Test Template Append Attributes Without Params + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-speed-two-datasetid-sample.jsonld -*** Test Cases *** +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME 010_01_01 Append entity attributes - Append Attributes Without Params - ... 204 - ... vehicle-new-attribute-fragment.jsonld - ... vehicle-speed-appended-expectation.jsonld - -010_01_02 Append entity attributes - Append Attributes With Params - ... 207 - ... vehicle-attribute-to-add-fragment.jsonld - ... add-attribute-expectation.jsonld - ... vehicle-speed-appended-expectation.jsonld - -010_01_03 Append entity attributes - 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 + 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld +010_01_02 Append entity attributes with different datasetid + 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld *** Keywords *** @@ -45,50 +28,23 @@ Append Attributes Without Params [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} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - ${response}= Retrieve Entity by Id - ... ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} -Append Attributes With Params - [Documentation] Check that you can append entity attributes - [Tags] ea-append 5_6_3 - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} +Create Initial Entity ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Append Entity Attributes With Parameters - ... ${entity_id} - ... ${fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} - ... noOverwrite - Check Response Status Code ${status_code} ${response.status_code} - # ignore the reason for the not updated attribute as this detail is up to each context broker implementation - IF "${expectation_response_body}"!="${EMPTY}" - Check Response Body Content - ... ${expectation_response_body} - ... ${response.json()} - ... root\\['notUpdated'\\]\\[0\\]\\['reason'\\] - END - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - ${response}= Retrieve Entity by Id - ... ${entity_id} - ... context=${ngsild_test_suite_context} - ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index faf6b987ecb29b51cb3abf71a63e7ab9e41432e5..dc002913dd23d9d6cc8b5376740ddcd9caedf60f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -5,6 +5,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity +Test Template Append Attributes + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -14,15 +18,11 @@ ${status_code}= 400 ${invalid_fragment_filename}= invalid-fragment.jsonld -*** Test Cases *** +*** Test Cases *** ENTITY_INVALID_ID 010_02_01 Append entity attributes if the entity Id is not present - Append Attributes ${EMPTY} - + ${EMPTY} 010_02_02 Append entity attributes if the Entity Id is not a valid URI - Append Attributes thisisaninvaliduri - -010_02_03 Append entity attributes with invalid entity fragments - Append entity attributes with invalid entity fragments + thisisaninvaliduri *** Keywords *** @@ -30,34 +30,22 @@ Append Attributes [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} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id ${entity_id} -Append entity attributes with invalid entity fragments - [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] ea-append 5_6_3 +Create Initial Entity ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Append Entity Attributes - ... ${entity_id} - ... ${invalid_fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response.status_code} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} - Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Set Test Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 84e356c9ec06db686f7d2ae174f47b2e79dd47b4..72ba2e556e6708f46a4dbcc3ed32c3eaf3388f53 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -29,4 +29,4 @@ ${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Keywords *** Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..80ebd7095096add71c13add952811a82b8aa9aa4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check that you can append entity attributes + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity +Test Template Append Attributes With Params + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld + + +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_BODY EXPECTATION_FILENAME +010_04_01 Append entity attributes and ignore existing multi-attribute instance + 204 vehicle-attribute-to-add-fragment.jsonld ${EMPTY} vehicle-speed-appended-expectation.jsonld +010_04_02 Append entity attributes with a new multi-attribute instance + 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld + + +*** Keywords *** +Append Attributes With Params + [Documentation] Check that you can append entity attributes + [Tags] ea-append 5_6_3 + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} + ${response}= Append Entity Attributes With Parameters + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... noOverwrite + Check Response Status Code ${status_code} ${response.status_code} + # ignore the reason for the not updated attribute as this detail is up to each context broker implementation + IF "${expectation_response_body}"!="${EMPTY}" + Check Response Body Content + ... expectation_filename=${expectation_response_body} + ... response_body=${response.json()} + ... additional_ignored_path=root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + END + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Set Global Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_05.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..81f4950f51e8fbb4ef8b35f13412dcec50b8044f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_05.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** 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_05_01 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 + ${response}= Append Entity Attributes + ... ${entity_id} + ... ${invalid_fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} + Check Response Body Title When Using Session Request ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Set Test Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${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 48c0c209782eee0933225cfb8e6492e577a567d9..65211d518a2ccfbcc225ad77bc569a1c5acc8135 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -33,25 +33,25 @@ Delete Attributes [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} ${response}= Delete Entity Attributes - ... ${entity_id} - ... ${attribute_id} - ... ${datasetId} - ... ${deleteAll} - ... ${ngsild_test_suite_context} + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... datasetId=${datasetId} + ... deleteAll=${deleteAll} + ... context=${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - ${response}= Retrieve Entity by Id - ... ${entity_id} + ${response2}= Retrieve Entity by Id + ... id=${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response2.json()} ${ignored_attributes} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 237b4e81673d217f37ab5f8dfd07ceaf1896f29f..b47d4490166983a7ba9d9ec5fb1d3bca044846a0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -5,42 +5,42 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Teardown Delete Initial Entity Test Template Delete Attributes *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID EXPECTED_STATUS_CODE 013_02_01 Delete an attribute if the Entity Id is not present - ${EMPTY} speed + ${EMPTY} speed 400 013_02_02 Delete an attribute if the Entity Id is not a valid URI - thisIsAnInvalidURI speed + thisIsAnInvalidURI speed 400 013_02_03 Delete an attribute if the Attribute Name is not present - ${valid_entity_id} ${EMPTY} + ${valid_entity_id} ${EMPTY} 405 *** Keywords *** Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 - [Arguments] ${entity_id} ${attribute_id} - ${response}= Create Entity Selecting Content Type + [Arguments] ${entity_id} ${attribute_id} ${expected_status_code} + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${valid_entity_id} + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false - Check Response Status Code ${status_code} ${response.status_code} - -Setup Initial Entities - ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${valid_entity_id} - -Delete Initial Entities - Delete Entity by Id Returning Response ${valid_entity_id} + Check Response Status Code 201 ${create_response.status_code} + ${response}= Delete Entity Attributes + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... datasetId=${EMPTY} + ... deleteAll=false + Check Response Status Code ${expected_status_code} ${response.status_code} + +Delete Initial Entity + Delete Entity by Id ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index a4dc22d7f20eb4c587779ac5f6103b0b4b6141c8..222757546543a3ffa4a92ef04da2898d8226953b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Entity +Test Teardown Delete Initial Entity Test Template Delete Attributes @@ -30,10 +30,14 @@ Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 [Arguments] ${entity_id} ${attribute_id} ${datasetId} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false + ${response}= Delete Entity Attributes + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... datasetId=${datasetId} + ... deleteAll=false Check Response Status Code ${status_code} ${response.status_code} -Setup Initial Entities +Setup Initial Entity ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${valid_entity_id} ${response}= Create Entity Selecting Content Type @@ -44,5 +48,5 @@ Setup Initial Entities ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} -Delete Initial Entities - Delete Entity by Id Returning Response ${valid_entity_id} +Delete Initial Entity + Delete Entity by Id ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 6369296bf5761ab0a481e8f830884d07f437557b..5ac36e31817523095b444826c093ba6edd01067d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Initiate Test Case Test Teardown Delete Initial Entities Test Template Update Attributes @@ -28,6 +29,21 @@ Update Attributes [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} + ${response}= Partial Update Entity Attributes + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... fragment_filename=${fragment_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + +Initiate Test Case ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type @@ -35,19 +51,6 @@ Update Attributes ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Partial Update Entity Attributes - ... ${entity_id} - ... ${attribute_id} - ... ${fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response.status_code} - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - ${response}= Retrieve Entity by Id - ... ${entity_id} - ... context=${ngsild_test_suite_context} - ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index a48a3aac5d628e560139b403be97675d447b46cd..299a2f7b92629f03223439cb5830b35de705abec 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Setup Initial Entity +Test Teardown Delete Initial Entity Test Template Update Attributes @@ -21,11 +21,9 @@ ${status_code}= 400 ${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 +012_02_03 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 +012_02_04 Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.json @@ -34,25 +32,25 @@ Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${valid_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes - ... ${entity_id} - ... ${attribute_id} - ... ${fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... fragment_filename=${fragment_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} -Setup Initial Entities +Setup Initial Entity ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${valid_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} -Delete Initial Entities - Delete Entity by Id Returning Response ${valid_entity_id} +Delete Initial Entity + Delete Entity by Id ${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 2614655404863d36f956d9005c9c775db552fb41..411c751a6dc208e2691880ea5855c3cb760408d7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Teardown Delete Initial Entities +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity Test Template Partial Update Attributes @@ -25,7 +25,7 @@ ${default_attr_id}= speed 012_03_03 Partial update when no instance with the datasetId specified ${valid_entity_id} ${default_attr_id} vehicle-speed-unknown-datasetid-fragment.jsonld 012_03_04 Partial update when the Attribute Name does not exist in the entity - ${valid_entity_id} speed2 vehicle-speed-no-datasetid-fragment.jsonld + ${valid_entity_id} isParked2 vehicle-isparked-fragment.jsonld *** Keywords *** @@ -33,27 +33,27 @@ Partial Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${attr_id} ${fragment_filename} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${valid_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes - ... ${entity_id} - ... ${attr_id} - ... ${fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} + ... entityId=${entity_id} + ... attributeId=${attr_id} + ... fragment_filename=${fragment_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} -Setup Initial Entities +Create Initial Entity ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${valid_entity_id} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${not_found_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} -Delete Initial Entities - Delete Entity by Id Returning Response ${valid_entity_id} +Delete Initial Entity + Delete Entity by Id ${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 7f62c67b985db11ff2d7e96792b579571798a958..8fbac35714e18d3f67f13a2fa892c875d8bfb0c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Initialize Test Test Teardown Delete Initial Entities Test Template Update Attributes @@ -20,8 +21,8 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld 011_01_02 Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld -011_01_03 Check that you can update only some attributes while others failed - 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld +011_01_03 Check that you can update only some attributes while unknown are ignored + 204 vehicle-speed-two-datasetid-03-fragment.jsonld ${EMPTY} expectations/vehicle-multi-attributes-expectation.jsonld *** Keywords *** @@ -31,27 +32,34 @@ Update Attributes [Arguments] ... ${status_code} ... ${fragment_filename} - ... ${expectation_response_filename} + ... ${expectation_resp_filename} ... ${expectation_filename} - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${entity_id} - ${response}= Create Entity Selecting Content Type - ... ${filename} + ${response}= Update Entity Attributes ... ${entity_id} + ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} - IF "${expectation_response_filename}"!="${EMPTY}" - Check Response Body Content ${expectation_response_filename} ${response.json()} + IF "${expectation_resp_filename}"!="${EMPTY}" + Check Response Body Content + ... expectation_filename=${expectation_resp_filename} + ... response_body=${response.json()} END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} - ${response}= Retrieve Entity by Id - ... ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} + +Initialize Test + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} 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 eac6045a164474f7094a7009a88e7f380aacfca0..6cbe3811cd320e2d0ed10e26f097ca66927d0130 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -5,64 +5,42 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Initialize Environment +Test Teardown Delete Entity +Test Template Update Attributes + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** +*** Test Cases *** ENTITY_INVALID_ID FRAGMENT_FILENAME 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 - + ${EMPTY} vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_02 Update an attribute if the Entity Id is not a valid URI - Update Attributes - ... thisisaninvaliduri - ... vehicle-two-datasetid-attributes-sample.jsonld - ... vehicle-speed-two-datasetid-01-fragment.jsonld - -011_02_03 Update entity attributes with invalid entity fragments - Update entity attributes with invalid entity fragments - ... vehicle-speed-two-datasetid-sample.jsonld - ... invalid-fragment.jsonld + thisisaninvaliduri vehicle-speed-two-datasetid-01-fragment.jsonld *** Keywords *** Update Attributes [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} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + [Arguments] ${entity_invalid_id} ${fragment_filename} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} -Update entity attributes with invalid entity fragments - [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] ea-update 5_6_2 - [Arguments] ${filename} ${fragment_filename} +Initialize Environment ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type - ... ${filename} + ... vehicle-two-datasetid-attributes-sample.jsonld ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Update Entity Attributes - ... ${entity_id} - ... ${fragment_filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response.status_code} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} - Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Delete Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 25f93dd221500b2fae3772695d98c30238a073e5..936cce7df0f885a08cdd426c3fd558971bba84a4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -29,4 +29,4 @@ ${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Keywords *** Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..457f38f197f8531834c77ff98c990600eaf3763d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_04.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Initialize Environment ${filename} +Test Template Update entity attributes with invalid entity fragments + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld + + +*** Test Cases *** +011_04_01 Update entity attributes with invalid entity fragments + vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld + + +*** Keywords *** +Update entity attributes with invalid entity fragments + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] ea-update 5_6_2 + [Arguments] ${filename} ${fragment_filename} + ${response}= Update Entity Attributes + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response.status_code} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} + Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id ${entity_id} + +Initialize Environment + [Arguments] ${filename} + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} 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 7e539d847a70ccbdb66983ee2003b220e3b2c352..591c0d5ab014c513ae1ba04f097f21f385a59e8b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -29,20 +29,20 @@ Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${content_type} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${content_type} Check Response Status Code 201 ${response.status_code} ${created_temporal_entity}= Load Test Sample ... temporalEntities/${filename} ... ${temporal_entity_representation_id} IF '${content_type}'=='application/json' - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} END IF '${content_type}'=='application/ld+json' - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} END ${ignored_attributes}= Create List instanceId @context @@ -51,7 +51,7 @@ Create Temporal Entity ... ${temporal_entity_representation_id} Check Created Resource Set To ... ${temporal_entity_expectation_payload} - ... ${response.json()} + ... ${response1.json()} ... ${ignored_attributes} Delete Temporal Entity 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 9eca17552fc221198bc4324c237b61ce3ce7c9b1..d9ced397244b3a973726b269730d975500463cde 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -5,23 +5,18 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Create Temporal Entity From File + *** Variables *** ${status_code}= 400 -*** Test Cases *** +*** Test Cases *** FILENAME 007_02_01 Create a temporal entity with an invalid json - Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld - + vehicle-temporal-representation-invalid-json-sample.jsonld 007_02_02 Create a temporal entity with an empty json - Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld - -007_02_03 Create a temporal entity with missing id - Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld - -007_02_04 Create a temporal invalid URI - Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + vehicle-temporal-representation-empty-json-sample.jsonld *** Keywords *** @@ -35,14 +30,3 @@ Create Temporal Entity From File Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} - -Create Temporal Entity - [Documentation] Check that you cannot create a temporal entity with an invalid @context - [Tags] te-create 5_6_11 - [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_code} - [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..a2104f090df14f9bf39a90ad1674a6a92102a8f9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_03.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Temporal Entity + + +*** Variables *** +${status_code}= 400 + + +*** Test Cases *** ENTITY_ID FILENAME +007_03_01 Create a temporal entity with missing id + ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld +007_03_02 Create a temporal invalid URI + invalidId vehicle-temporal-representation-sample.jsonld + + +*** Keywords *** +Create Temporal Entity + [Documentation] Check that you cannot create a temporal entity with an invalid @context + [Tags] te-create 5_6_11 + [Arguments] ${entity_id} ${filename} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${entity_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index 3c65c89111a67abdb3752eb4f9d80b21a0fdc399..924ee1d346538ad9229841efacd9d7a2bd06d3f8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Initial Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -16,16 +18,21 @@ ${filename}= vehicle-temporal-representation-sample.jsonld 009_01_01 Delete a temporal representation of an entity with simple temporal properties [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties [Tags] te-delete 5_6_16 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response}= Delete Temporal Representation Of Entity With Returning Response ... ${temporal_entity_representation_id} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} - Check SUT Not Containing Resource ${response.status_code} + Check SUT Not Containing Resource ${response1.status_code} + + +*** Keywords *** +Create Initial Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} 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 edd9c51ec9337bbea8aecd08a7f716f32ea3fd79..8e3a2cd61c2043b5949f3080130f447b7269ed60 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -12,21 +12,23 @@ Test Template Delete Temporal Entity ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE 009_02_01 Delete a temporal representation of an entity with an empty entity id - 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${EMPTY} 405 ${EMPTY} 009_02_02 Delete a temporal representation of an entity with an invalid entity id - 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + invalidId 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Temporal Entity [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} + [Arguments] ${id} ${expected_status_code} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} - Check Response Status Code ${status_code} ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END 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 c4ad5dc6b12ba7a6ed4ec1b61e40b3f72ce9c3d1..ae5cf6be47766bbce200d431e2e61f078dae1802 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -23,26 +23,26 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ${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} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${update_filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response.status_code} + ${response1}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${update_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response1.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response2}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${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} - ... ${response.json()} + ... ${response2.json()} ... ${ignored_attributes} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot index 0119eda01e415e02a1e3f3ce39475c2c74de2e59..1fdb1f2c1c3aca798ef6346a94c76cbe52e9a99f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot @@ -22,11 +22,11 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${fragment_filename} @@ -35,14 +35,14 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${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} - ... ${response.json()} + ... ${response1.json()} ... ${ignored_attributes} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot index 1a34a8a723e7c2e7f7efd360359e1bd95e52f46a..70f62e5086e3784c6385fc67644401b7ba98085a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Add Attribute To Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -13,50 +15,24 @@ ${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${status_code}= 400 -*** Test Cases *** -014_02_01 Add an attribute to a temporal representation of an entity with invalid content - Add an Attribute To a Temporal Entity From File vehicle-temporal-representation-invalid-json-fragment.jsonld - -014_02_02 Add an attribute to a temporal representation of an entity with empty content - Add an Attribute To a Temporal Entity From File vehicle-temporal-representation-empty-json-fragment.jsonld - -014_02_03 Add an attribute to a temporal representation of an entity with an empty entity id - Add Attribute To Temporal Entity ${EMPTY} - -014_02_04 Add an attribute to a temporal representation of an entity with an invalid entity id - Add Attribute To Temporal Entity thisIsAninvalidId +*** Test Cases *** ID +014_02_01 Add an attribute to a temporal representation of an entity with an empty entity id + ${EMPTY} +014_02_02 Add an attribute to a temporal representation of an entity with an invalid entity id + thisIsAninvalidId *** Keywords *** -Add an Attribute To a Temporal Entity From File - [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} - Check Response Status Code 201 ${response.status_code} - ${response}= Append Attribute To Temporal Entity - ... ${temporal_entity_representation_id} - ... ${update_filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response.status_code} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} - Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - Add Attribute To Temporal Entity [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} - Check Response Status Code 201 ${response.status_code} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot index 04e5dc3d2e35de0e9af2c8fb47c08ef62dac52ca..c20cae2a59409d2296a633056b92040035cccfd7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot @@ -21,11 +21,11 @@ ${status_code}= 404 [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Attribute To Temporal Entity ... ${not_found_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..ab6d9fcd5e77ff94e1fae7664ccb79d94927a131 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that an error is raised if you add a temporal entity attribute with empty/invalid content + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Initialize Test Case +Test Template Add an Attribute To a Temporal Entity From File + + +*** Variables *** +${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 *** UPDATE_FILENAME +014_04_01 Add an attribute to a temporal representation of an entity with invalid content + vehicle-temporal-representation-invalid-json-fragment.jsonld +014_04_02 Add an attribute to a temporal representation of an entity with empty content + vehicle-temporal-representation-empty-json-fragment.jsonld + + +*** Keywords *** +Add an Attribute To a Temporal Entity From File + [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} + ${response}= Append Attribute To Temporal Entity + ... ${temporal_entity_representation_id} + ... ${update_filename} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} + Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Initialize Test Case + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} 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 38c3b9f4b24c4d7fdac1f1e64efce0a9cbff20b3..f854ab85953db99428ca837cca489eda548b38b4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Initialize Setup Test Teardown Delete Temporal Entity Test Template Delete Attribute From A Temporal Entity @@ -17,7 +18,7 @@ ${status_code}= 204 ${attribute_id}= fuelLevel -*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE +*** Test Cases *** DELETE_ALL DATASET_ID 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 @@ -30,34 +31,36 @@ ${attribute_id}= fuelLevel Delete Attribute From A Temporal Entity [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties [Tags] tea-delete 5_6_13 - [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + [Arguments] ${delete_all} ${dataset_id} ${expectation_filename} ${response}= Delete Attribute From Temporal Entity - ... ${temporal_entity_representation_id} - ... ${attribute_id} - ... ${CONTENT_TYPE_JSON} - ... ${datasetId} - ... ${deleteAll} - ... ${ngsild_test_suite_context} + ... entityId=${temporal_entity_representation_id} + ... attributeId=${attribute_id} + ... content_type=${CONTENT_TYPE_JSON} + ... datasetId=${datasetid} + ... deleteAll=${deleteall} + ... context=${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${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} - ... ${response.json()} + ... ${response1.json()} ... ${ignored_attributes} +Initialize Setup + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 0f169072669c02f08271dced81e759981d094728..4fdefef439f1cb135938127cc74a5d93c130d7c2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -31,11 +31,11 @@ Delete attribute from temporal entity with unknow entity/attribute id [Tags] tea-delete 5_6_13 [Arguments] ${entity_id} ${attribute_id} ${response}= Delete Attribute From Temporal Entity - ... ${entity_id} - ... ${attribute_id} - ... ${CONTENT_TYPE_JSON} - ... ${EMPTY} - ... false + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... content_type=${CONTENT_TYPE_JSON} + ... datasetId=${EMPTY} + ... deleteAll=false Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -45,9 +45,9 @@ Delete attribute from temporal entity with unknow entity/attribute id Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${valid_temporal_entity_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} + ... temporal_entity_representation_id=${valid_temporal_entity_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} Set Test 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 920e917d34abddbd4b95e34daf6a6708a53d59b6..cd7bc1b3ff7a1bac4d5d4221b589641df8d6d9b8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Create Id Test Teardown Delete Temporal Entity -Test Template Delete Attribute +Test Template Delete An Attribute *** Variables *** @@ -24,22 +24,17 @@ ${status_code}= 404 *** Keywords *** -Delete Attribute +Delete An Attribute [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 [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_code} ${response}= Delete Attribute From Temporal Entity - ... ${entity_id} - ... ${attribute_id} - ... ${CONTENT_TYPE_JSON} - ... ${EMPTY} - ... false - ... ${ngsild_test_suite_context} + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... content_type=${CONTENT_TYPE_JSON} + ... datasetId=${EMPTY} + ... deleteAll=false + ... context=${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -51,6 +46,11 @@ Create Id ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${valid_temporal_entity_id} Set Test Variable ${unknown_temporal_entity_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${valid_temporal_entity_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} Delete Temporal Entity Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 2753b3541352288f32ba8d95af2faeeb8f67713c..072e7cb8e85292d977ac462804d4236210efd3ea 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -22,16 +22,16 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc [Tags] tea-instance-delete 5_6_15 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + ${retrieve_response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} + ${instanceId}= Set Variable ${retrieve_response.json()['speed'][0]['instanceId']} ${response}= Delete Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} ... ${attributeId} @@ -42,14 +42,14 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${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} - ... ${response.json()} + ... ${response1.json()} ... ${ignored_attributes} 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 1e4f33add27794ea09e19d4ef695b932a70c5a9d..a62015a700760e028c7027256deb2937c36a56a4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -47,9 +47,9 @@ Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index bd6dc186bec17567350af71f790416c5fb450dcd..9f79daea6e38ca92f377e3bf5b5bfe9950de7ef4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Create Id Test Teardown Delete Intitial Temporal Representation Of Entity -Test Template Delete Attribute Instance +Test Template Delete An Attribute Instance *** Variables *** @@ -27,7 +27,7 @@ ${status_code}= 404 *** Keywords *** -Delete Attribute Instance +Delete An Attribute Instance [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 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} @@ -43,9 +43,9 @@ Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${unknown_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index b7d13a3671e5cd01e1ee79f8a686abe9aac6dc0c..3d7eebc55a5b3a445ca686748a698b42afc8e458 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -25,34 +25,34 @@ ${attributeId}= speed 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} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response1}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_before_update}= Set Variable ${response.json()['speed'][0]['instanceId']} + ${instanceId_before_update}= Set Variable ${response1.json()['speed'][0]['instanceId']} - ${response}= Modify Attribute Instance From Temporal Entity + ${response2}= 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_code} + Check Response Status Code 204 ${response2.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - ${response}= Retrieve Temporal Representation Of Entity - ... ${temporal_entity_representation_id} + ${response3}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_after_update}= Set Variable ${response.json()['speed'][0]['instanceId']} + ${instanceId_after_update}= Set Variable ${response3.json()['speed'][0]['instanceId']} Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} @@ -62,7 +62,7 @@ ${attributeId}= speed ${ignored_attributes}= Create List instanceId @context modifiedAt Check Updated Resource Set To ... ${temporal_entity_expectation_payload} - ... ${response.json()} + ... ${response3.json()} ... ${ignored_attributes} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index ae9ff1e69335ee9f741915f446ad54be33551881..26cabf40245e9b406d0a0e869678af69c02cfb16 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -15,29 +15,28 @@ Test Template Modify Attribute Instance Temporal Entity ${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 +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID EXPECTED_STATUS_CODE 016_02_01 Modify attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} + invalidId speed ${valid_instanceId} 400 016_02_02 Modify attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} + ${EMPTY} speed ${valid_instanceId} 400 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 + ${temporal_entity_representation_id} speed invalidId 400 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} + ${temporal_entity_representation_id} speed ${EMPTY} 405 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} + ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} 400 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} 405 *** Keywords *** Modify Attribute Instance Temporal Entity [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 - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${expected_status_code} ${response}= Modify Attribute Instance From Temporal Entity ... ${temporal_entity_id} ... ${attributeId} @@ -45,15 +44,15 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response.status_code} + Check Response Status Code ${expected_status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... ${temporal_entity_representation_id} - ... ${filename} - ... ${CONTENT_TYPE_LD_JSON} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index 71d99fb2c737e30871d44eda9a80ec1a93a34910..cde5c1e5913703b515221a28aa5932959e5754c5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -45,9 +45,9 @@ 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} + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${unknown_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 9b645bac01c263a099b2079634f2e49248ed9732..07a8f00e5df26347dfae9316ef3390db818c40e5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -25,11 +25,11 @@ ${subscription_expectation_file_path}= subscriptions/expectations/subscript ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} - ${response}= Retrieve Subscription - ... ${subscription_id} + ${response1}= Retrieve Subscription + ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Created Resource Set To ${expected_subscription} ${response.json()} + Check Created Resource Set To ${expected_subscription} ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index b63fcbc81b4ac07380978f1999f4e57f261ff304..34c28ec73cbdea385f3a85c1d4558fe91a964163 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -16,7 +16,8 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Cases *** ID 028_03_01 InvalidId invalidId -028_03_02 EmptyId ${EMPTY} +028_03_02 EmptyId + ${EMPTY} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index 9b22a193a94d92d7820e41eeb3b3e0522d23063e..a819183f2597e6fc576a7ee43a67f73462d82ed6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -19,7 +19,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Set Suite Variable ${subscription_id} - ${response}= Create Subscription + ${initial_response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index c27bb38fc10728313110b1e64de3d79fbd65c4f2..d91dc8e1bdcf2efcfe092bbaa8c832aa68c21c61 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -1,5 +1,5 @@ *** 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 +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 shall be raised Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -7,20 +7,24 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Delete Subscription With Non present Or Invalid Id -*** Test Cases *** id -032_01_01 NotPresentId [Tags] sub-delete 5_8_5 - ${EMPTY} -032_01_02 InvalidId [Tags] sub-delete 5_8_5 - InvalidUri +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE +032_01_01 NotPresentId + [Tags] sub-delete 5_8_5 + ${EMPTY} 405 ${EMPTY} +032_01_02 InvalidId + [Tags] sub-delete 5_8_5 + InvalidUri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Subscription With Non present Or Invalid Id - [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - [Arguments] ${id} + [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 shall be raised + [Arguments] ${id} ${expected_status_code} ${problem_type} ${response}= Delete Subscription ${id} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 52011a916f68f237ac5db3ffe85bd8c4a43df97b..e87684fe33ff0803734f8e5474854d0e181dd99a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -6,7 +6,6 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions *** Variables *** @@ -20,8 +19,9 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld [Tags] sub-delete 5_8_5 ${response}= Delete Subscription ${subscription_id} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} - Check SUT Not Containing Resource ${response.status_code} + ${response1}= Retrieve Subscription + ... id=${subscription_id} + Check SUT Not Containing Resource ${response1.status_code} *** Keywords *** @@ -29,6 +29,3 @@ Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - -Delete Initial Subscriptions - Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 2b5cad54986f85a0029c24411a4fb467bf6a6054..626eeb79ebbe0dc1e6dbc3c3e743581dbd8e4319 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -7,8 +7,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Retrieve Subscription With Invalid Id -*** Test Cases *** id -030_01_01 InvalidId [Tags] sub-retrieve 5_8_3 +*** Test Cases *** ID +030_01_01 InvalidId + [Tags] sub-retrieve 5_8_3 InvalidUri @@ -16,7 +17,8 @@ Test Template Retrieve Subscription With Invalid Id Retrieve Subscription With Invalid Id [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - ${response}= Retrieve Subscription ${id} + ${response}= Retrieve Subscription + ... id=${id} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index c6102510dba8dc36a2f846f297d3aa76c521e561..2b7a201b6346036bb85ccdcb5217ef4ff817a6ec 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -9,7 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource 030_02_01 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 - ${response}= Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription + ${response}= Retrieve Subscription + ... id=urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 3d9dbc6e2e14409ca8862ef70a8fc3c7c5e096cc..25166491cf5543f3f359a6040abacebd5e9ebfdf 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -19,7 +19,9 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions 030_03_01 Retrieve Subscription [Documentation] Check that you can retrieve a subscription [Tags] sub-retrieve 5_8_3 - ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Subscription + ... id=${subscription_id} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element ... ${expectation_file_path} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot index aea73282cda1f18c4004b5791339ca3bc8dd2670..ac00e333c44125659e45bcc28fd16408e9db2657 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot @@ -27,10 +27,9 @@ ${notification_server_send_url}= http://${notification_server_host}:${not Add Initial Entity Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} @@ -40,6 +39,14 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -50,21 +57,13 @@ Setup Initial Subscriptions 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 - 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 Subscriptions + Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot index 1ae54eb5b76d48c55212a78db791342fb35c8360..f9905f726c632189e6ebed2f0fc0e426f7e7948d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot @@ -23,10 +23,7 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld 046_02_01 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_8_6 046_02 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions + ${response}= Setup Initial Subscriptions ${notification} ${headers}= Wait for notification timeout=${15} @@ -42,31 +39,32 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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 ${entity_id} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - -Delete Initial Entity - Delete Entity by Id ${entity_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot index 55a3a61c1269384aeeb011943ac76ff160eabe3a..2be76dd978eb16c294c907c18192173e762782f3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot @@ -24,10 +24,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_03_01 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_8_6 046_03 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions + ${response}= Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -42,16 +39,30 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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 ${entity_id} Set Suite Variable ${subscription_id} + Create Entity ${entity_building_filepath} ${entity_id} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + Delete Initial Subscriptions Delete Subscription ${subscription_id} @@ -62,11 +73,3 @@ Add Initial Entity Delete Initial Entity Delete Entity by Id ${entity_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} - -After Test - Delete Initial Subscriptions - Delete Initial Entity - Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot index c3d91068ad2be82764a2500133f3a3f8f5ccb769..cca119a3f70a3fac71884a84c0c4c0e853f1206a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot @@ -24,11 +24,9 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_04_01 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_8_6 046_04 + ${response}= Setup Initial Subscriptions - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response1}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} Should be Equal ${subscription_id} ${notification}[subscriptionId] @@ -40,31 +38,32 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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 ${entity_id} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - -Delete Initial Entity - Delete Entity by Id ${entity_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot index 53bb74844337febdd21e144ee43a0f3b1ac0a1c2..4eb6bc5f2247054d550820621deef4f5cd43c3dc 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot @@ -24,11 +24,9 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_05_01 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_8_6 046_05 - - Add Initial Entity - Sleep 1s Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} Should be Equal ${subscription_id} ${notification}[subscriptionId] @@ -41,31 +39,32 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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 ${entity_id} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - -Delete Initial Entity - Delete Entity by Id ${entity_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot index 7f9afb76d4b0c5a590f8cfd937a360dd27b63390..6c190eb5fd2a4213df2335fdb00af10fb6dde058 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot @@ -21,9 +21,12 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Test Cases *** 046_06_01 Check that a notification is sent with all matching entities - [Documentation] Only the subscribed Entities matching the query shall be included. + [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. [Tags] sub-notification 5_8_6 046_06 - ${entity_building}= Create Entity Selecting Content Type + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} @@ -40,13 +43,13 @@ Setup Server And Subscriptions ... ${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} Start Local Server ${notification_server_host} ${notification_server_port} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} + + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s Delete Server And Subscriptions Delete Subscription ${subscription_id} - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id ${entity_id} Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot index 5893ecaa7bfebe3014d66d97013e1a035c742620..06e138fad338a5e4e2d8a8506eec032f87381d50 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot @@ -7,8 +7,9 @@ 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 Suite +Suite Teardown After Suite +Test Teardown After Test *** Variables *** @@ -28,25 +29,22 @@ ${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ 046_07_01 Check notification structure [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above [Tags] sub-notification 5_8_6 046_07_01 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + [Setup] Setup Initial Subscriptions ${subscription_payload_file_path} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${notified_at_date}= Parse Ngsild Date ${notification}[notifiedAt] Should Not Be Equal ${notified_at_date} ${None} - [Teardown] Delete Fixture Data 046_07_02 Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). [Tags] sub-notification 5_8_6 046_07_02 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + [Setup] Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification Should Be Equal ${notification}[type] Notification @@ -54,15 +52,13 @@ ${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ ${notified_at_date}= Parse Ngsild Date ${notification}[notifiedAt] Should Not Be Equal ${notified_at_date} ${None} Dictionary Should Contain Key ${notification}[data][0] airQualityLevel - [Teardown] Delete Fixture Data 046_07_03 Check URI expansion is observed [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). [Tags] sub-notification 5_8_6 046_07_03 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions ${subscription_payload_file_path_default_context} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + [Setup] Setup Initial Subscriptions ${subscription_payload_file_path_default_context} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification Should Be Equal ${notification}[type] Notification @@ -70,38 +66,32 @@ ${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ ${notified_at_date}= Parse Ngsild Date ${notification}[notifiedAt] Should Not Be Equal ${notified_at_date} ${None} Dictionary Should Contain Key ${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - [Teardown] Delete Fixture Data *** Keywords *** +Before Suite + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions - [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} + [Arguments] ${subscription_payload_path} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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} + Set Test Variable ${entity_id} + Set Test Variable ${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} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s -Delete Initial Entity +After Test + Delete Subscription ${subscription_id} Delete Entity by Id ${entity_id} -Delete Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} - -After Test +After Suite Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot index 397f05dde80124aeb911f7f41fc4fb532abb257c..7dbc0f0a57cef265310ec7152597175a6264b0e4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot @@ -6,9 +6,11 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource +Library ${EXECDIR}/libraries/logUtils.py -Suite Setup Before Test -Suite Teardown After Test +Suite Setup Before Suite +Suite Teardown After Suite +Test Teardown After Test *** Variables *** @@ -23,13 +25,10 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 046_08_01 Check that a notification is sent with all attributes [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included - [Tags] sub-notification 5_8_6 046_08_01 + [Tags] sub-notification 5_8_6 046_08 + [Setup] Setup Initial Subscriptions ${False} - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} @@ -41,66 +40,55 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 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 046_08_02 Check that a notification is sent with all attributes in simplified format [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided - [Tags] sub-notification 5_8_6 046_08_02 + [Tags] sub-notification 5_8_6 046_08 + [Setup] Setup Initial Subscriptions ${True} - Add Initial Entity - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint - ... ${subscription_payload_file_path} - ... ${subscription_id} - ... ${notification_server_send_url} - ${subscription_payload}= Update Value To JSON - ... ${subscription_payload} - ... $..notification['format'] - ... keyValues - ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty - Should Be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal ${entity_id} ${notification}[data][0][id] Should be Equal Eiffel Tower ${notification}[data][0][name] - [Teardown] Delete Fixture Data *** Keywords *** +Before Suite + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions + [Arguments] ${change_json} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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} + IF "${change_json}" == "${True}" + ${subscription_payload}= Update Value To JSON + ... ${subscription_payload} + ... $..notification['format'] + ... keyValues + END + + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Set Test Variable ${entity_id} + Set Test Variable ${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} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s -Delete Initial Entity +After Test + Delete Subscription ${subscription_id} Delete Entity by Id ${entity_id} -Delete Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} - -After Test +After Suite Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot index 4478fa41ed2854b0c6da632789a4b327b21ec506..cc49770faa6ee7c2909de770dce95dcb4a0cd635 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot @@ -25,42 +25,41 @@ ${notification_server_send_url} http://${notification_server_host}:${not [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_8_6 046_09 - Add Initial Entity - Sleep 1s Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} Dictionary Should Contain Key ${headers} X-Additional-Key *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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 ${entity_id} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} + Create Entity ${entity_building_filepath} ${entity_id} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s 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 Subscriptions + Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot index 785bc200f83ddba8bb79515184dcfe86da51a8f8..fbda28c0df04ee38eb9979fd31ae15d0ac144f32 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot @@ -26,45 +26,43 @@ ${expected_header_links} <${ngsild_test_suite_context}>; rel="htt [Documentation] The Notification shall be sent as JSON [Tags] sub-notification 5_8_6 046_10 - Add Initial Entity - Sleep 1s Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} Dictionary Should Contain Item ${headers} Link ${expected_header_links} - Dictionary Should Not Contain Key ${notification}[data][0] @context *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_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} + Set Suite Variable ${entity_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} + Create Entity ${entity_building_filepath} ${entity_id} + Sleep 1s + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Sleep 1s 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 Subscriptions + Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot index 76a9c22e20f6e1d53d5565239940823ac3a13d33..75392451d0e7bf25e505edd5ff0dd7c8d65576ee 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot @@ -36,15 +36,18 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ Wait for notification timeout=${10} ${response}= Retrieve Subscription - ... ${subscription_id} + ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} Dictionary Should Contain Key ${response.json()}[notification] timesSent - Should Be Equal ${1} ${response.json()}[notification][timesSent] + Should be Equal ${1} ${response.json()}[notification][timesSent] *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -55,21 +58,18 @@ Setup Initial Subscriptions 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 - Start Local Server ${notification_server_host} ${notification_server_port} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} 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 Subscriptions + Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot index 7dd5003d1dbd88b2b2c3a41a0a2553b9f061ef78..6f81177793f82b92930e615540724c5d0b4d6032 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot @@ -34,14 +34,14 @@ ${notification_server_send_url}= http://${notification_server_host}:${not Wait for notification timeout=${10} ${response}= Retrieve Subscription - ... ${subscription_id} + ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal ok ${notification_info}[0][status] + Should be Equal ok ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastNotification ${last_notification_date}= Parse Ngsild Date ${notification_info}[0][lastNotification] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot index 6007a7ab9d39869800d244af0b58498b648b7fca..7f79fd41ab1332bf00d8d98674c1bf6d064ccc9d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot @@ -31,14 +31,14 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld Sleep 10s ${response}= Retrieve Subscription - ... ${subscription_id} + ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal failed ${notification_info}[0][status] + Should be Equal failed ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastFailure ${last_failure_date}= Parse Ngsild Date ${notification_info}[0][lastFailure] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot index 05fe6d3feb3398fe8b9274216f726bf67834c42e..ecf8a9128aca26f35b26da764857daad2041b3a8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot @@ -22,16 +22,17 @@ ${notification_server_send_url} http://${notification_server_host}:${not *** Test Cases *** 046_14_01 Check that a notification is sent as JSON-LD - [Documentation] The Notification content shall be JSON-LD when endpoint.accept is set to JSON-LD + [Documentation] The Notification content shall be JSON-LD when endpoint.accept is set to 'application/ld+json' [Tags] sub-notification 5_8_6 046_14 Add Initial Entity Sleep 1s Setup Initial Subscriptions + Sleep 1s - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait For Notification timeout=${10} + ${notification} ${headers}= Wait For Notification timeout=${10} Reply By 200 ${notification_headers}= Get Request Headers diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 9af5deda5eb0ca4cc2048d299b5ad7dc6724b632..13dab30b609843c4d8ba26aabb2e419dd7de1a02 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -1,5 +1,5 @@ *** 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 +Documentation Check that you cannot update 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/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -12,20 +12,24 @@ Test Template Update Subscription With Non present Or Invalid Id ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json -*** Test Cases *** id -029_01_01 NotPresentId [Tags] sub-update 5_8_2 - ${EMPTY} -029_01_02 InvalidId [Tags] sub-update 5_8_2 - InvalidUri +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE +029_01_01 NotPresentId + [Tags] sub-update 5_8_2 + ${EMPTY} 405 ${EMPTY} +029_01_02 InvalidId + [Tags] sub-update 5_8_2 + InvalidUri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Update Subscription With Non present Or Invalid Id - [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - [Arguments] ${id} + [Documentation] Check that you cannot update 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} ${expected_status_code} ${problem_type} ${response}= Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 6463410c38fd8788fb4561ae0260b8dc346b9f60..557cf6d463c4ba3f89937a2ab29ad8aa0480c0f4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -1,5 +1,5 @@ *** 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 +Documentation Check that you cannot update a subscription: 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/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -17,7 +17,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Test Cases *** 029_03_01 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 + [Documentation] Check that you cannot update a subscription: 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 ${response}= Update Subscription ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 072ddd0f077dc344230d67bcf982de5aadb01492..f99ebf8a8cec2fab89f9564e05fa1db8b594bd66 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -18,7 +18,7 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio *** Test Cases *** -029_05_01 Update Subscription With Term to Uri Expansion +029_05_01 Update Subscription With Term to Uri Expansion with Context [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed [Tags] sub-update 5_8_2 ${response}= Update Subscription @@ -27,16 +27,29 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + ${response1}= Retrieve Subscription + ... id=${subscription_id} + ... context=${ngsild_test_suite_context} Check Response Body Containing Subscription element ... ${expected_subscription_payload_file_path} ... ${subscription_id} - ... ${response.json()} - ${response}= Retrieve Subscription ${subscription_id} + ... ${response1.json()} + +029_05_02 Update Subscription With Term to Uri Expansion without Context + [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed + [Tags] sub-update 5_8_2 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response1}= Retrieve Subscription + ... id=${subscription_id} Check Response Body Containing Subscription element ... ${expected_expanded_subscription_payload_file_path} ... ${subscription_id} - ... ${response.json()} + ... ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index b5c22a8437a8af5711a91ed3898e73725e26bc73..0ea7eef0b329c5199450a2cf50fd8d9079232790 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can update a subcription: The implementation shall modify the target Subscription +Documentation Check that you can update a subscription: The implementation shall modify the target Subscription Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -17,7 +17,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Test Cases *** 029_06_01 Update Subscription - [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription + [Documentation] Check that you can update a subscription: The implementation shall modify the target Subscription [Tags] sub-update 5_8_2 ${response}= Update Subscription ... ${subscription_id} @@ -27,12 +27,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Check Response Status Code 204 ${response.status_code} ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - ${response}= Retrieve Subscription - ... ${subscription_id} + ${response1}= Retrieve Subscription + ... id=${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} ${response.json()} ${ignored_attributes} + Check Updated Resource Set To ${subscription} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index d3815a65860242736276b80a986dcbd374199eb6..6a8c6f2842b084d2a2ec029cfc372943c851cdc6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -16,7 +16,8 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-samp *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -029_07_01 ActiveTrue [Tags] sub-update 5_8_2 +029_07_01 ActiveTrue + [Tags] sub-update 5_8_2 subscriptions/fragments/subscription-isActive-true-update-sample.json @@ -29,8 +30,12 @@ Activate Paused Subscription With isActive Member ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} active + ${response1}= Retrieve Subscription + ... id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=active Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index cf2be65011f6355f207cd19494b87c95385d652b..18585700311272fdd283de01d1c5748696f6643f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" +Documentation Check that you can update a subscription: 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/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -23,15 +23,19 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-samp *** Keywords *** Activate Paused Subscription With isActive And ExpiresAt Members - [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" + [Documentation] Check that you can update a subscription: 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} ${response}= Update Subscription ... ${subscription_id} ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} active + ${response1}= Retrieve Subscription + ... id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=active Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 1049328d8c0e8a15693f37736a9accab845ec8ea..0330b7d5fb11b4926699d1c686204ee4e0bc9582 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -24,8 +24,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} paused + ${response1}= Retrieve Subscription + ... id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=paused *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 19bcd40d32ce20f29470bd29abf468c5f7e4f522..3b70a8c3dd7321a5f76e2a9273e3ede9a1fe7087 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -25,7 +25,7 @@ ${subscription_update_fragment_file_path} subscriptions/fragments/subscrip ${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} - ${response}= Update Subscription With Payload + ${update_response}= Update Subscription With Payload ... ${subscription_id} ... ${update_fragment} ... ${CONTENT_TYPE_JSON} @@ -35,8 +35,12 @@ ${subscription_update_fragment_file_path} subscriptions/fragments/subscrip ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} active + ${response1}= Retrieve Subscription + ... id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=active *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot index b3190fb2c30805801670ae3fbed0fa861b672a74..409d62472d6b94978d53639583574771d2f729e1 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Created Context Source Registrations -Test Template Query Context Source Registration +Test Template Query A Context Source Registration *** Variables *** @@ -27,7 +27,7 @@ ${second_context_source_registration_payload_file_path}= csourceRegistrations *** Keywords *** -Query Context Source Registration +Query A Context Source Registration [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 [Arguments] ... ${query_param_name} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot index cfb155833227452447e126167330c7f710447be0..217f7112453edc1801c365739bdefec5bc573bfb 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot @@ -31,11 +31,11 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo ${context_source_registration_payload}= Load Test Sample ... ${registration_file_path} ... ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} - ... type=Building + ... type=Vehicle ... attrs=name @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code 200 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot index f7d43d632b9fd20bb7ba283937ead05fc8ef16ab..580aa1fcc8fa77914da1f59195a3f145203541f7 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot @@ -20,7 +20,7 @@ ${expectation_file_path}= csourceRegistrations/exp 037_08_01 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 - ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} type=Building + ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} type=Vehicle @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot index 15fcfa2efb251e1362944ae7d4f14fe04cc8fdcc..a0bece03a5fc7da31fed1a3c460133f4be3f9bd8 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot @@ -41,7 +41,7 @@ Query Context Source Registration Matching Temporal Query ${context_source_registration_payload}= Load Test Sample ... ${payload_file_path} ... ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot index 35acf4076bdf03862f4e7d4930dbac9dc54a278a..54d702b45d05c815cd4f830940a44b98cff1c3c8 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot @@ -9,9 +9,11 @@ Test Template Retrieve Context Source Registration With A Not Present Or I *** Test Cases *** ID -036_01_01 Not Present Id [Tags] csr-retrieve 5_10_1 +036_01_01 Not Present Id + [Tags] csr-retrieve 5_10_1 ${EMPTY} -036_01_02 Invalid Id [Tags] csr-retrieve 5_10_1 +036_01_02 Invalid Id + [Tags] csr-retrieve 5_10_1 invalidUri @@ -19,7 +21,8 @@ Test Template Retrieve Context Source Registration With A Not Present Or I 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} - ${response}= Retrieve Context Source Registration ${id} + ${response}= Retrieve Context Source Registration + ... context_source_registration_id=${id} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_02.robot index 58876bf6b4736ec878c3b2a331f2f28e62ab99c1..0a0f6a85e32499f0ce1cf1294200364788a6d4ba 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_02.robot @@ -10,7 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource 036_02_01 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 - ${response}= Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration + ${response}= Retrieve Context Source Registration + ... context_source_registration_id=urn:ngsi-ld:ContextSourceRegistration:unknowRegistration Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot index 939b051e6100c88eb0098b9205980fd05280918b..2e708d16fca654422fd59cb8089f7d578a797140 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot @@ -20,7 +20,8 @@ ${expectation_file_path}= csourceRegistrations/exp 036_03_01 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 - ${response}= Retrieve Context Source Registration ${context_source_registration_id} + ${response}= Retrieve Context Source Registration + ... context_source_registration_id=${context_source_registration_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expectation_file_path} diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot index b10b589227e5afd2e0197ae3a6bf48f51e97918e..eeb98d89c4e543f4711a151db0654deae3dc7fe9 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot @@ -21,7 +21,7 @@ ${expectation_file_path}= csourceRegistrations/exp [Documentation] Check that you can retrieve a Context Source Registration [Tags] csr-retrieve 5_10_1 ${response}= Retrieve Context Source Registration - ... ${context_source_registration_id} + ... context_source_registration_id=${context_source_registration_id} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot index 0157c7320e94bd9cf30d4f5bee6403c13c731aea..4a0d3d3ffb4ccf589d7c6973f99671fa49c82bd6 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Setup Initial Context Source Registration Test Teardown Delete Created Context Source Registration -Test Template Check JSON-LD resolution when retrieving a context source registration +Test Template Review JSON-LD resolution when retrieving a context source registration *** Variables *** @@ -28,10 +28,12 @@ ${expectation_file_path_expanded}= csourceRegistrations/exp *** Keywords *** -Check JSON-LD resolution when retrieving a context source registration +Review JSON-LD resolution when retrieving a context source registration [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} - ${response}= Retrieve Context Source Registration ${context_source_registration_id} context=${context} + ${response}= Retrieve Context Source Registration + ... context_source_registration_id=${context_source_registration_id} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expected_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index d9ad866685f161e592b44282efee0a1423d59ba7..42f6ec072aa5dda7c6ee0ea74b2b2f4117f9d961 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -9,19 +9,21 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= context-source-registration-sample.jsonld *** Test Cases *** 035_01_01 Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id - [Tags] csr-delete + [Tags] csr-delete 5_9_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response.status_code} + ${create_response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${create_response.status_code} ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource ${response.status_code} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + ... context=${ngsild_test_suite_context} + Check SUT Not Containing Resource ${response1.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 9df303c7026238e421fcd4fd25e7d01c96dfbb98..074493f9fb193c467ea3acbd176740e6ee79638d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -5,13 +5,14 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Initial Context Source Registration Test Teardown Delete Created Context Source Registrations -Test Template Delete Context Source +Test Template Delete A Context Source *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +${filename}= context-source-registration-sample.jsonld *** Test Cases *** INVALID_REGISTRATION_ID @@ -24,19 +25,20 @@ ${filename}= context-source-registration-simple-sample.jsonld *** Keywords *** -Delete Context Source +Delete A Context Source [Documentation] Check that you cannot delete a context source registration under some conditions [Arguments] ${invalid_registration_id} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Test Variable ${registration_id} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response.status_code} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} Delete Created Context Source Registrations Delete Context Source Registration ${registration_id} + +Create Initial Context Source Registration + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index 9f10d77a2e27656e76c704576c4285a6fe84ed8c..57ea1288be3e08c13478ef134bcb7bfb69938120 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -14,7 +14,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sampl *** Test Cases *** 035_03_01 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 + [Tags] csr-delete 5_9_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 404 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot index 087d000b8be4aa19ab314f2c5cae49947e68b33e..4937159967700ce8f2b733a87519ab717e06a421 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot @@ -17,19 +17,19 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** 033_01_01 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 + [Tags] csr-create 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Context Source Registration - ... ${registration_id} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${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} ${response.json()} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot index 3487a96dd0b831b514a8d07a530a0a36e829a84c..969d976439364bd202b0ef751c28de25d4d9871b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot @@ -17,7 +17,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** 033_01_02 Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires - [Tags] csr-create + [Tags] csr-create 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} @@ -25,12 +25,12 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${registration_id} ${response.headers} - ${response}= Retrieve Context Source Registration - ... ${registration_id} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${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} ${response.json()} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot index ea46d7c01539d728337dc1360f8cfe120a52fcd5..45c92422ffd068073da3c0ab35c7bf01e5290ef9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot @@ -17,19 +17,19 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** 033_01_03 Create Context Source Registration Without A Sprecified ID [Documentation] Check that you can create a context source registration without specifying an ID - [Tags] csr-create + [Tags] csr-create 5_9_2 ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response.status_code} ${registration_id}= Check Response Headers ID Not Empty ${response.headers} Set Suite Variable ${registration_id} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Retrieve Context Source Registration - ... ${registration_id} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${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} ${response.json()} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot index 5c471249b0a2e8a9439a544674c65c78a6096bb6..ab4f1485cd3c82f046d13c217755ba6a33ff5444 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot @@ -2,51 +2,23 @@ Documentation Check that you cannot create a context source with invalid content Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Library OperatingSystem *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-invalid-sample.jsonld *** Test Cases *** 033_02_01 Create a context source registration with invalid JSON file - [Tags] csr-create 5_9_2 - 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 - [Tags] csr-create 5_9_2 - 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 - [Tags] csr-create 5_9_2 - Create Context Source With Invalid Content - ... csourceRegistrations/context-source-registration-past-expiration-sample.jsonld - - -*** Keywords *** -Create Context Source With Invalid Content - [Documentation] Check that you cannot create a context source with invalid content - [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} - ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 400 ${response.status_code} - Check Response Headers Containing URI set to ${registration_id} ${response.headers} - [Teardown] Delete Context Source Registration ${registration_id} - -Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Tags] csr-create 5_9_2 + ${subscription_payload}= Get File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration - ... ${registration_payload_file_path} + ... ${subscription_payload} Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_03.robot index cffdca07edf7381d366fad2c3c72ea8a38c3454c..1af3676f1ff6c84e2f19fb5a53ac716dc7c997ea 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_03.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Created Context Source Registrations +Test Setup Create New Context Source Registration +Test Teardown Delete Created Context Source Registrations *** Variables *** @@ -16,13 +17,7 @@ ${filename}= csourceRegistrations/context-source-registration *** Test Cases *** 033_03_01 Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Suite Variable ${registration_id} - ${payload}= Load JSON From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response.status_code} + [Tags] csr-create 5_9_2 ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} @@ -31,3 +26,12 @@ ${filename}= csourceRegistrations/context-source-registration *** Keywords *** Delete Created Context Source Registrations Delete Context Source Registration ${registration_id} + +Create New Context Source Registration + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + Set Test Variable ${updated_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_04.robot index bbe6e1262cfd4a05f48e888a39e281dac4bc4343..9a4bb29d18d226d955044ce98e8b22c246743e8a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_04.robot @@ -15,7 +15,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_04_01 Create one context source registration using a provided Link header with JSON content type +033_04_01 Create one context source registration using a provided Link header with JSON content type with Context [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} @@ -27,13 +27,32 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information'][0]['entities'][0]['type'] Building ${response.json()} - ${response}= Retrieve Context Source Registration ${registration_id} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + ... context=${ngsild_test_suite_context} + Check JSON Value In Response Body + ... ['information'][0]['entities'][0]['type'] + ... Building + ... ${response1.json()} + +033_04_02 Create one context source registration using a provided Link header with JSON content type without Context + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} Check JSON Value In Response Body ... ['information'][0]['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building - ... ${response.json()} + ... ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_05.robot index 2dc29a41a59a6c96199f6dcb4d5b15ba304ad049..31efe47e817300777335ff759eaafbaf451e0dd9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_05.robot @@ -15,8 +15,8 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_05_01 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 +033_05_01 Create one context source registration using the default context with JSON content type with Context + [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 and retrieve the information with ngsild context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -26,13 +26,31 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... ${updated_payload} ... ${CONTENT_TYPE_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + ... context=${ngsild_test_suite_context} Check JSON Value In Response Body ... ['information'][0]['entities'][0]['type'] ... ngsi-ld:default-context/Building - ... ${response.json()} - ${response}= Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information'][0]['entities'][0]['type'] Building ${response.json()} + ... ${response1.json()} + +033_05_02 Create one context source registration using the default context with JSON content type without Context + [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 and retrieve the information without ngsild context + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response.status_code} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + Check JSON Value In Response Body + ... ['information'][0]['entities'][0]['type'] + ... Building + ... ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot index 5b04fc52224d0d732f4c9d7aef334c117905139d..b208fbb66fc5d780af419e6c1d6489bbabc508b8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot @@ -15,8 +15,8 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_07_01 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" +033_07_01 Create one context source registration using a JSON-LD @context obtained from the request payload with Context + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" and retrieve the information with ngsild context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -26,13 +26,31 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information'][0]['entities'][0]['type'] Building ${response.json()} - ${response}= Retrieve Context Source Registration ${registration_id} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + ... context=${ngsild_test_suite_context} + Check JSON Value In Response Body + ... ['information'][0]['entities'][0]['type'] + ... Building + ... ${response1.json()} + +033_07_02 Create one context source registration using a JSON-LD @context obtained from the request payload without Context + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" and retrieve the information without ngsild context + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} Check JSON Value In Response Body ... ['information'][0]['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building - ... ${response.json()} + ... ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_10.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_10.robot new file mode 100644 index 0000000000000000000000000000000000000000..c154e6adef5e8bf8b9cd76b3998b587ac63e0d07 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_10.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot create a context source with invalid content + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Context Source With Invalid Content + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: + + +*** Test Cases *** +033_10_01 Create a context source registration with a different data structure than CsourRegistration data type + csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld +033_10_02 Create a context source registration with a date in the past + csourceRegistrations/context-source-registration-past-expiration-sample.jsonld + + +*** Keywords *** +Create Context Source With Invalid Content + [Documentation] Check that you cannot create a context source with invalid content + [Tags] csr-create 6_3_5 + [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} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 400 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index e91f5d8f0955ea359ddc35c4d0e246fbd842b857..ced78716a0f1a51f082fe1a2ec34f5bcaa3f01dd 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -6,8 +6,9 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Initialize the Test Case Test Teardown Delete Updated Context Source Registration -Test Template Update Context Source +Test Template Update A Context Source *** Variables *** @@ -20,19 +21,14 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02 Update a context source registration to never expire [Tags] csr-update 5_9_3 - context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld + context-source-registration-with-expiration-sample.jsonld context-source-registration-sample.jsonld *** Keywords *** -Update Context Source +Update A Context Source [Documentation] Check that you can update a context source registration by id [Arguments] ${filename} ${update_filename} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Test Variable ${registration_id} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} + Set Test Variable ${filename} ${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 @@ -40,12 +36,22 @@ Update Context Source ... ${registration_update_fragment} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Context Source Registration - ... ${registration_id} + Check Retrieving Context Source Registration + ... registration_id=${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} ${response.json()} ${ignored_attributes} + ... registration_payload=${registration_payload} Delete Updated Context Source Registration Delete Context Source Registration ${registration_id} + +Initialize the Test Case + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} + # ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${payload}= Load JSON From File + ... ${EXECDIR}/data/csourceRegistrations/context-source-registration-sample.jsonld + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} + Set Test Variable ${registration_payload} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 23904f8006c4ab3e83fa2ff61df56b06a3685a59..a879a3c627c7ac2977e9252a2f5d393994cb365e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -5,47 +5,33 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Create Initial Context Source Registration +Test Teardown Delete Initial Context Source Registration +Test Template Update A Context Source *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +${filename}= context-source-registration-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 - [Tags] csr-update 5_9_3 - Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld - + ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld 034_02_02 Update a context source registration by id if the Id is not a valid URI - [Tags] csr-update 5_9_3 - Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld - + 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 - [Tags] csr-update 5_9_3 - 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 - [Tags] csr-update 5_9_3 - Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld - -034_02_05_Update a context source registration if the request body is invalid - [Tags] csr-update 5_9_3 - Update a context source registration if the request body is invalid + ${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 + ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld *** Keywords *** -Update Context Source +Update A Context Source [Documentation] Check that you cannot update a context source registration under some conditions + [Tags] csr-update 5_9_3 [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} - ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response.status_code} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return @@ -54,24 +40,14 @@ Update Context Source ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Context Source Registration ${valid_registration_id} -Update a context source registration if the request body is invalid - [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} +Create Initial Context Source Registration + ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${valid_registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${updated_payload}= Update Value To JSON ${payload} $..id ${valid_registration_id} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response.status_code} - ${response}= Update Context Source Registration - ... ${registration_id} - ... ${registration_payload_file_path} - Check Response Status Code ${response.json()} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} -Setup Initial Entities - ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Suite Variable ${valid_registration_id} +Delete Initial Context Source Registration + Delete Context Source Registration ${valid_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 13b434d99ed0f5b7a104aebff8299abe0996d508..8b4f64c9a4bb96c5daeebbb4e2566673042ed8e1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -5,18 +5,16 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Updated Context Source Registration - *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +${filename}= context-source-registration-sample.jsonld *** Test Cases *** 034_03_01 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 + [Tags] csr-update 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} @@ -27,8 +25,3 @@ ${filename}= context-source-registration-simple-sample.jsonld ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - - -*** Keywords *** -Delete Updated Context Source Registration - Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_04.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..6eb6eb679252d48f2453d2b659131959bb159b65 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_04.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration under some conditions + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Context Source Registration +Test Teardown Delete Initial Context Source Registration + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld + + +*** Test Cases *** +034_04_01 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 5_9_3 + ${response}= Update Context Source Registration + ... ${registration_id} + ... ${registration_payload_file_path} + # Check Response Status Code ${response.json()} + Check Response Status Code 400 ${response.status_code} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + +*** Keywords *** +Create Initial Context Source Registration + ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${valid_registration_id} + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Context Source Registration + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot index cac02b0f111fec272fe1c83924b8871bdeec986e..2162618cff2b2ebcdea9602bce2456f6ab000cfc 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot @@ -7,8 +7,8 @@ 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 +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -28,13 +28,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ... ${subscription_id} Set Suite Variable ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} - Wait for notification # Wait for 15 seconds to check if another notification was sent Wait for notification timeout=${15} *** Keywords *** -Setup Initial Context Source Registrations +Setup Initial Context Source Registration Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample @@ -43,7 +42,7 @@ Setup Initial Context Source Registrations Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot index 6242241fa33b4146aa571ba386b6534aa4373948..0c53e8595ed828a78cb3cbbb9ee9b0d259387528 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot @@ -7,8 +7,8 @@ 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 +Test Setup Create Initial Context Source Registration and Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Context Source Registration Subscription *** Variables *** @@ -23,36 +23,41 @@ ${update_fragment_file_path}= csourceRegistrations/fra 047_02_01 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 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} - Set Suite Variable ${subscription_id} - ${response}= Create Context Source Registration Subscription ${subscription_payload} - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... updated + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=updated *** Keywords *** -Setup Initial Context Source Registrations +Create Initial Context Source Registration and Context Source Registration Subscription 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} + Set Suite Variable ${context_source_registration_id} + Set Suite Variable ${subscription_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} -Delete Created Context Source Registrations And Subscriptions + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Set Suite Variable ${expected_context_source_registration_ids} + Wait for notification and validate it + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching + +Delete Created Context Source Registration And Context Source Registration Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot index 6f51a560ddb4e997b4ea2c7354576d15189793be..0b16106de8dfd05ca58b4f0207a50d1b110abe9a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -31,14 +31,14 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub @{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} + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching + ... expected_notification_data_entities=${expected_notification_data_entities} *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -47,7 +47,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot index 227ef3bd9bd98fae1c9a735f6ff95eb0adb9b1fb..6584958c4562d4f9eacf20e0994e960cfdbd8cc5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot index 6e291625e07a974938065bd43e5d6c1eedda2647..dd559ba87eaef0ddec615e59ca793c4c61fe367f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -28,9 +28,10 @@ ${notification_expectation_file_path}= notifications/expectatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} Wait for notification - ${response}= Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastSuccess Check NotificationParams ... ${notification_expectation_file_path} @@ -39,7 +40,7 @@ ${notification_expectation_file_path}= notifications/expectatio *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -48,7 +49,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot index 399c68e97ff6affc431452a0a79ff84643462944..36875da4ecc033dd797ee0c63844cb9b579fbdbc 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -28,9 +28,10 @@ ${notification_expectation_file_path}= notifications/expectatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification - ${response}= Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ... ${notification_expectation_file_path} @@ -39,14 +40,14 @@ ${notification_expectation_file_path}= notifications/expectatio *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot index 62557282a4adc4882c42e0efb2b7f2e1573ae8c1..7f51c7287e8404045ae4e7997c751932c7df7d63 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active @@ -36,15 +36,16 @@ Do Not Receive cSourceNotification If Subscription Status Is Not Active ${response}= Update Context Source Registration Subscription ... ${subscription_id} ... ${subscription_update_fragment} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${response1}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -53,7 +54,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions - Stop Local Server +Delete Created Context Source Registration And Subscription Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} + Stop Local Server diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot index 946a91022dd32af22cbd5468be9def3f794b75ee..bddc4ffa27632757f22f2ca39d1d5e71fde076b6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot @@ -7,8 +7,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Setup Create Initial Context Source Registration and Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Context Source Registration Subscription *** Variables *** @@ -27,13 +27,13 @@ ${update_fragment_file_path}= csourceRegistrations/fra ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... updated + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=updated *** Keywords *** -Setup Initial Context Source Registrations And Subscriptions +Create Initial Context Source Registration and Context Source Registration Subscription 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} @@ -48,7 +48,7 @@ Setup Initial Context Source Registrations And Subscriptions Set Suite Variable ${context_source_registration_id} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Context Source Registration Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot index 03089aaa128b85a512236b8527bd1af1f0bbd31a..30de1c0b9c00a7b1857c50ab1197ae8b74b0846a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot @@ -7,8 +7,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Suite Setup Create Initial Context Source Registration And Context Source Registration Subscription +Suite Teardown Delete Created Context Source Registration And Context Source Registration Subscription *** Variables *** @@ -27,13 +27,13 @@ ${update_fragment_file_path}= csourceRegistrations/fra ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... noLongerMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=noLongerMatching *** Keywords *** -Setup Initial Context Source Registrations And Subscriptions +Create Initial Context Source Registration And Context Source Registration Subscription 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} @@ -48,7 +48,7 @@ Setup Initial Context Source Registrations And Subscriptions Set Suite Variable ${context_source_registration_id} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Context Source Registration Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot index 9089f74b851dfbef2126fcefd54ed3726b754478..edb70308503d5b85431b784eb439f11e9bb28dfd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot index 23b0ed3600f3369f26f107ce5f5c7a94b31639ae..52cbf11f25e09a4a72c7fa11427e6d1b0724f484 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot @@ -39,12 +39,12 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - ${response}= Create Context Source Registration ${context_source_registration_payload} + ${response1}= 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 + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching Delete Created Context Source Registrations Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot index 41ced7db74b61a5e7149711859c363878552eeea..59d620a2693814fba033a39a18bde17da6e637ca 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot index 520332f5fe81a00ed7cd51af5c700fdb371f19c1..5a24fab77af87802aecc2056afa1e2d9bd86bcfb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot index 26f5dedb2472af346b56691dbf61c390098eafb0..3ab8c25894b46291ba1e50cab007997e021a10c7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot index 05f5ac653ff1c7e6c817f1db95e6136c2b66be70..792bc9cdd18d6490c3ffed683d34e042230b1f3b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot @@ -7,8 +7,8 @@ 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 Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration And Subscription *** Variables *** @@ -30,13 +30,13 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it - ... ${subscription_id} - ... ${expected_context_source_registration_ids} - ... newlyMatching + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${expected_context_source_registration_ids} + ... expected_trigger_reason=newlyMatching *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -45,7 +45,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registration And Subscription Stop Local Server Delete Context Source Registration ${context_source_registration_id} Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot index 210e8fef0b4b96295744b49740cb1e96178f71fc..9f140f2a24840975675693fc9176582f084ce99a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot @@ -7,8 +7,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Setup Setup Initial Context Source Registrations And Subscriptions -Test Teardown Delete Created Context Source Registrations And Subscriptions +Test Setup Create Initial Context Source Registrations And Context Source Registration Subscription +Test Teardown Delete Created Context Source Registrations And Context Source Registration Subscription Test Template Receive cSourceNotification For Newly Matching Context Source Registrations @@ -40,9 +40,12 @@ Receive cSourceNotification For Newly Matching Context Source Registrations ${response}= Update Context Source Registration Subscription ... ${subscription_id} ... ${subscription_update_fragment} - Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching + Wait for notification and validate it + ... expected_subscription_id=${subscription_id} + ... expected_context_source_registration_ids=${notification_csr_ids} + ... expected_trigger_reason=newlyMatching -Setup Initial Context Source Registrations And Subscriptions +Create Initial Context Source Registrations And Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} @@ -63,7 +66,7 @@ Setup Initial Context Source Registrations And Subscriptions Set Test Variable ${first_context_source_registration_id} Set Test Variable ${second_context_source_registration_id} -Delete Created Context Source Registrations And Subscriptions +Delete Created Context Source Registrations And Context Source Registration Subscription Stop Local Server Delete Context Source Registration Subscription ${subscription_id} Delete Context Source Registration ${first_context_source_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 61c3ba5c09559a6082fc629dd64a5035f19fa498..60796e30d1cc27772547cd00e71e67e210c472a8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -22,12 +22,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} - ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${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} ${response.json()} ${ignored_attributes} + Check Created Resource Set To ${subscription_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 685b12bcc26d92c66a7e35e9db99ff5cac760c81..be5f0caeb80245ed4252e97de81188b86dea6402 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -23,12 +23,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Set Suite Variable ${subscription_id} - ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${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} ${response.json()} ${ignored_attributes} + Check Created Resource Set To ${subscription_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index 44dd144cdfcda390bb41bf06a096a09ae7e9464f..69208861e08fd82f6cbf13723a03fee2851a3c9d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -22,8 +22,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} - ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} active + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=active *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index 2ce7edd3681552eca4875e9af7aea05b4c301cf5..e59b8a923ddbfea227d540ae83eb6596d3b8d133 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -22,8 +22,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-inacti ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} - ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} paused + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=paused *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index adab47b88c208c63828b23b48ad3f6cca6f51a08..e377447634149d76de1264a93006ab035d329b54 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -26,8 +26,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expire Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Sleep 15s - ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} expired + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=expired *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index 132c48775bd228f73c95433aae66af0d0fd200f1..9ef56fc3a0585edb21fc5e586938167bf8829e07 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -24,8 +24,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Check Response Headers Containing URI set to ${subscription_id} ${response.headers} # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough Sleep 10s - ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status ${response.json()} active + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=active *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 2d014c9d1e377ce0c9a06ab1a9eaa0033d12ec94..db8fbe78059b98098447a727547dc6c21ca96a49 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Initial Context Source Registration Subscription *** Variables *** @@ -28,11 +28,11 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} -Delete Initial Context Source Registration Subscriptions +Delete Initial Context Source Registration Subscription Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index 9a9fad6e816c8c8a0252a10e36dbfc57cffecdeb..8a119eaa98afc374a7c5c1762f2f9a9899a942bf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -17,9 +17,11 @@ ${subscription_payload_file_path}= ${EMPTY} 038_08_01 WithoutNotification [Tags] csrsub-create 5_11_2 csourceSubscriptions/subscription-without-notification-sample.jsonld -038_08_02 InvalidType [Tags] csrsub-create 5_11_2 +038_08_02 InvalidType + [Tags] csrsub-create 5_11_2 csourceSubscriptions/subscription-invalid-type-sample.jsonld -038_08_03 InvalidQuery [Tags] csrsub-create 5_11_2 +038_08_03 InvalidQuery + [Tags] csrsub-create 5_11_2 csourceSubscriptions/subscription-invalid-query-sample.jsonld 038_08_04 EmptyWatchedAttributes [Tags] csrsub-create 5_11_2 diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index e8c85751546b4555c123a7f0d95d2caf59440882..39108b3e46297879f516778b58b067eebd223124 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -5,7 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscription *** Variables *** @@ -19,14 +19,14 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample [Tags] csrsub-delete 5_11_6 ${response}= Delete Context Source Registration Subscription ${subscription_id} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} ... context=${ngsild_test_suite_context} - Check SUT Not Containing Resource ${response.status_code} + Check SUT Not Containing Resource ${response1.status_code} *** Keywords *** -Setup Initial Context Source Registration Subscriptions +Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 10e2ed1a8c2cfacb0b93fde989143675f275ef06..67535b429bd60977fdd182c07d92df56f2b914f9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Created Context Source Registration Subscription *** Variables *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 0aa8358ab936021d5d327c1cb793da52cf201fde..b1f013ca8bf4e368e3fd48f52de6e86c051e45ce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -33,14 +33,14 @@ ${expectation_file_path}= csourceSubscriptions/expectation *** Keywords *** Query Context Source Registration Subscriptions With Limit Parameter [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved - [Arguments] ${limit} ${expectation_subscription_number} + [Arguments] ${limit} ${expected_subscription_number} ${response}= Query Context Source Registration Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ... Subscription - ... ${expectation_subscription_number} + ... ${expected_subscription_number} ... ${response.json()} Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index 9094d6c34e74ab236cb315b523a91a7194f0c5bb..bdf0fc8a96a3c2505157bd30df16c3deb3940d3c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -32,7 +32,7 @@ ${third_subscription_payload_file_path}= csourceSubscriptions/subscriptio *** Keywords *** Query Context Source Registration Subscriptions With Limit And Page Parameters [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + [Arguments] ${limit} ${page} ${expected_subscription_number} ${prev_link} ${next_link} ${response}= Query Context Source Registration Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} @@ -40,7 +40,7 @@ Query Context Source Registration Subscriptions With Limit And Page Parameters Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ... Subscription - ... ${expectation_subscription_number} + ... ${expected_subscription_number} ... ${response.json()} Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index 9ae02e4a6c00b60403e84e0e8da9fc50fe2c77fb..4847fb557bc0d84ab3e7f6f03f37130f1c9d496b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -9,9 +9,11 @@ Test Template Query Context Source Registration Subscriptions With Invalid *** Test Cases *** LIMIT PAGE -041_04_01 Invalid Limit [Tags] csrsub-query 5_11_5 +041_04_01 Invalid Limit + [Tags] csrsub-query 5_11_5 ${-5} ${2} -041_04_02 Invalid Page [Tags] csrsub-query 5_11_5 +041_04_02 Invalid Page + [Tags] csrsub-query 5_11_5 ${2} ${-3} 041_04_03 Invalid Limit And Page [Tags] csrsub-query 5_11_5 diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 5b97a1f73423e38759fd2ffa100509144e94db1a..723aea97769393fce9c88acd54f5ba9db56051c2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc 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 +Test Setup Setup Initial Context Source Registration Subscription +Test Teardown Delete Created Context Source Registration Subscription *** Variables *** @@ -20,7 +20,7 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr [Documentation] Check that you can retrieve a context source registration subscription [Tags] csrsub-retrieve 5_11_4 ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + ... subscription_id=${subscription_id} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index a6d73ef92a8451aca53a2332abb58cab7601b48e..c86cc31ab76a016492a1fd15649a4aac5b0938ec 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -10,7 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource 040_02_01 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 - ${response}= Retrieve Context Source Registration Subscription invalidUri + ${response}= Retrieve Context Source Registration Subscription + ... subscription_id=invalidUri Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index e05523f7189f2e00893800d15bf43e92c51f26ae..fd5dd105cf76b1bbf400561070b155305fbfb682 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -10,7 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource 040_03_01 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 - ${response}= Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + ${response}= Retrieve Context Source Registration Subscription + ... subscription_id=urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 9926142b0d725202bbcf60132b2b29362a27dc8a..0cf7c44becf736cacac7efa50458522a75a68ffe 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Initial Context Source Registration Subscriptions *** Variables *** @@ -25,11 +25,11 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ... ${subscription_update_fragment} Check Response Status Code 204 ${response.status_code} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + ${response1}= Retrieve Context Source Registration Subscription + ... subscription_id=${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${subscription} ${response.json()} + Check Updated Resource Set To ${subscription} ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 61bd43c1606cbbf0c9d02a2a1ae6cb5198891595..af44abfbaa41462beac23f5af04a63deefeabac0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -16,7 +16,8 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample *** Test Cases *** FILEPATH -039_04_01 InvalidType [Tags] csrsub-update 5_11_3 +039_04_01 InvalidType + [Tags] csrsub-update 5_11_3 csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json 039_04_02 InvalidNotification [Tags] csrsub-update 5_11_3 diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index f80af4b8ce6a2a096d2265a854d19097ad668fad..0115728e3099b40f4662534a2dc0eb669b8563ad 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubsc Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Initial Context Source Registration Subscriptions *** Variables *** diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json index 0ddd335ca69f8484aa28852e8b385235cb7b08d3..8ac5d04e6b11214d10470957896ec6cce9aec1ba 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json @@ -6,7 +6,7 @@ { "entities":[ { - "type":"Building" + "type":"Vehicle" } ] } diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json index 0ddd335ca69f8484aa28852e8b385235cb7b08d3..8ac5d04e6b11214d10470957896ec6cce9aec1ba 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json @@ -6,7 +6,7 @@ { "entities":[ { - "type":"Building" + "type":"Vehicle" } ] } diff --git a/data/entities/expectations/add-attribute-expectation.jsonld b/data/entities/expectations/add-attribute-expectation.jsonld deleted file mode 100644 index c6c6eb75115ed6f6fa660edeed6a6659691f13e2..0000000000000000000000000000000000000000 --- a/data/entities/expectations/add-attribute-expectation.jsonld +++ /dev/null @@ -1,11 +0,0 @@ -{ - "updated":[ - "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added" - ], - "notUpdated":[ - { - "attributeName": "https://ngsi-ld-test-suite/context#speed", - "reason": "a reason ignored during the comparison" - } - ] - } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld deleted file mode 100644 index d1ea2d5444c9e6b894986adef2672f3782e46ec7..0000000000000000000000000000000000000000 --- a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld +++ /dev/null @@ -1,6 +0,0 @@ -{ - "updated":[ - "https://ngsi-ld-test-suite/context#speed" - ], - "notUpdated":[ ] - } \ No newline at end of file diff --git a/data/entities/fragmentEntities/location-fragment.json b/data/entities/fragmentEntities/location-fragment.json new file mode 100644 index 0000000000000000000000000000000000000000..00006a2a814b7eb03cb0ee8b8ecf0b94d3f65f19 --- /dev/null +++ b/data/entities/fragmentEntities/location-fragment.json @@ -0,0 +1,12 @@ +{ + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + } +} \ No newline at end of file diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aee525a52dc2975ea3db365aa07d94cd3e6b6420 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,67 @@ +# Automatic generation of documentation data (ETSI RGS CIM 013) + +These python code has been developed to facilitate the automatic generation of the test purposes descriptions in a JSON +format in order to generate afterward automatically the NGSI-LD Test Purposes Descriptions (ETSI RGS CIM 013) document. +To achieve this purpose, we are defining a full Unit Test Suite with several Test Cases to check that we can generate +the corresponding information of the Robot description files. + +This approach has a clear advantage, from one side, we can generate the corresponding info for the ETSI document and +for the other side, it can help us to know when a change in the Robot Description files were developed and therefore +and update in the ETSI document (new version of the document) must be generated. + +## Requirements + +These python code is developed under the scope of the overall NGSI-LD Test Suite Code, therefore we use the same +requirements and python virtual environment already defined in [README.md](../README.md). + +## Structure + +The unit tests where divided into several groups following the NGSI-LD Test Suite Structure (ETSI RGS CIM 012) divided +in test groups and subgroups: + +- Group 1: Context Information (CI), Provision (PROV), defined in the [test_ContextInformation_Provision.py](./tests/test_ContextInformation_Provision.py) file. +- Group 2: Context Information (CI), Consumption (CONS), defined in the [test_ContextInformation_Consumption.py](./tests/test_ContextInformation_Consumption.py) file. +- Group 3: Context Information (CI), Subscription (SUB), defined in the [test_ContextInformation_Subscription.py](./tests/test_ContextInformation_Subscription.py) file. +- Group 4: Context Source (CS), Registration (REG), defined in the [test_ContextSource_Registration.py](./tests/test_ContextSource_Registration.py) file. +- Group 5: Context Source (CS), Discovery (DISC), defined in the [test_ContextSource_Discovery.py](./tests/test_ContextSource_Discovery.py) file. +- Group 6: Context Source (CS), Registration Subscription (REGSUB), defined in the +[test_ContextSource_RegistrationSubscription.py](./tests/test_ContextSource_RegistrationSubscription.py) file. +- Group 7: Common Behaviours (CB), defined in the [test_CommonBehaviours.py]() file. + +Additionally, a specific unit test called [test_CheckTests.py](./tests/test_CheckTests.py) was created to check that all +robot files have the corresponding unit tests. + +Moreover, the folder [files](./files) contains the expected results of the execution of the Unit Tests, and they are +divided into the NGSI-LD Test Suite Structure groups: + +- [CommonBehaviours](./files/CommonBehaviours) contains the expected results of the Common Behaviours robot files. +- [ContextInformation](./files/ContextInformation) contains the expected results of the Context Information files. +- [ContextSource](./files/ContextSource) contains the expected results of the Context Source files. + + +## Execution + +You have several options to execute the tests. it was generated a set of PyCharm configuration files in the +[runConfigurations](../.idea/runConfigurations) folder to help in the execution of the unit tests from the IDE: + +- [All Unit Tests](../.idea/runConfigurations/All_Unit_Tests.xml) executes all Unit Tests associated to the robot files. +- [CheckTests Unit Tests](../.idea/runConfigurations/CheckTests_Unit_Tests.xml) checks that there is a unit test associated to each robot file. +- [CommonBehaviours Unit Tests](../.idea/runConfigurations/CommonBehaviours_Unit_Tests.xml) executes Common Behaviours unit tests associated to the robot files. +- [ContextInformation Consumption Unit Tests](../.idea/runConfigurations/ContextInformation_Consumption_Unit_Tests.xml) executes Context Information - Consumption unit tests associated to +the robot files. +- [ContextInformation Provision Unit Tests](../.idea/runConfigurations/ContextInformation_Provision_Unit_Tests.xml) executes Context Information - Provision unit tests associated to the +robot files. +- [ContextInformation Subscription Unit Tests](../.idea/runConfigurations/ContextInformation_Subscription_Unit_Tests.xml) executes Context Information - Subscription unit tests associated +to the robot files. +- [ContextSource Discovery Unit Tests](../.idea/runConfigurations/ContextSource_Discovery_Unit_Tests.xml) executes Context Source - Discovery unit tests associated to the robot +files. +- [ContextSource Registration Unit Tests](../.idea/runConfigurations/ContextSource_Registration_Unit_Tests.xml) executes Context Source - Registration unit tests associated to the +robot files. +- [ContextSource RegistrationSubscription Unit Tests](../.idea/runConfigurations/ContextSource_RegistrationSubscription_Unit_Tests.xml) executes Context Source - Registration Subscription unit +tests associated to the robot files. +- [Generate Documentation Data](../.idea/runConfigurations/Generate_Documentation_Data.xml) executes Generate Document +Data unit tests associated to the unit test execution of a specific robot file (e.g. 047_01). The generated files are +located in the [results](./results) folder. +- [Statistics Documentation Data](../.idea/runConfigurations/Statistics_Documentation_Data.xml) executes all the test +to generate the documentation and generate statistics about the execution. The generated files are located in the +[results](./results) folder, a special file called `testcases.json` is generated with a list of all generated data. diff --git a/doc/__init__.py b/doc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/analysis/__init__.py b/doc/analysis/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/analysis/checks.py b/doc/analysis/checks.py new file mode 100644 index 0000000000000000000000000000000000000000..7305299587262f4a5cb2f779f1c6d610a0780678 --- /dev/null +++ b/doc/analysis/checks.py @@ -0,0 +1,934 @@ +from http import HTTPStatus + + +class Checks: + def __init__(self): + self.checks = { + 'Check Response Status Code': + Checks.check_response_status_code, + 'Check Response Body Containing Array Of URIs set to': + Checks.check_response_body_containing_array_of_uris_set_to, + 'Check Created Resources Set To': + Checks.check_created_resources_set_to, + 'Check Response Headers Containing Content-Type set to': + Checks.check_response_headers_containing_content_type_set_to, + 'Check Response Headers Link Not Empty': + Checks.check_response_headers_link_not_empty, + 'Check Response Headers Containing URI set to': + Checks.check_response_headers_containing_uri_set_to, + 'Check Response Headers ID Not Empty': + Checks.check_response_headers_id_not_empty, + 'Check Response Body Containing an Attribute set to': + Checks.check_response_body_containing_an_attribute_set_to, + 'Check Response Body Containing Entity element': + Checks.check_response_body_containing_entity_element, + 'Check Response Body Containing List Containing Entity Elements': + Checks.check_response_body_containing_list_containing_entity_elements, + 'Check Response Body Containing List Containing Entity Elements With Different Types': + Checks.check_response_body_containing_list_containing_entity_elements_with_different_types, + 'Check Response Body Containing EntityTemporal element': + Checks.check_response_body_containing_entitytemporal_element, + 'Check Response Body Containing List Containing EntityTemporal elements': + Checks.check_response_body_containing_list_containing_entitytemporal_elements, + 'Check Response Body Containing Subscription element': + Checks.check_response_body_containing_subscription_element, + 'Check Response Body Containing List Containing Subscription elements': + Checks.check_response_body_containing_list_containing_subscription_elements, + 'Check Response Body Containing Number Of Entities': + Checks.check_response_body_containing_number_of_entities, + 'Check Response Body Containing Context Source Registration element': + Checks.check_response_body_containing_context_source_registration_element, + 'Check Response Body Containing EntityTypeList element': + Checks.check_response_body_containing_entitytypelist_element, + 'Check Response Body Containing EntityType element': + Checks.check_response_body_containing_entitytype_element, + 'Check Response Body Containing EntityTypeInfo element': + Checks.check_response_body_containing_entitytypeinfo_element, + 'Check Response Body Containing AttributeList element': + Checks.check_response_body_containing_attributelist_element, + 'Check Response Body Containing Attribute element': + Checks.check_response_body_containing_attribute_element, + 'Check Response Body Containing List Containing Context Source Registrations elements': + Checks.check_response_body_containing_list_containing_context_source_registrations_elements, + 'Check Response Body Type When Using Session Request': + Checks.check_response_body_type_when_using_session_request, + 'Check Response Body Containing ProblemDetails Element Containing Type Element set to': + Checks.check_response_body_containing_problemdetails_element_containing_type_element_set_to, + 'Check Response Body Title When Using Session Request': + Checks.check_response_body_title_when_using_session_request, + 'Check Response Body Containing ProblemDetails Element Containing Title Element': + Checks.check_response_body_containing_problemdetails_element_containing_title_element, + 'Check RL Response Body Containing ProblemDetails Element Containing Type Element set to': + Checks.check_rl_response_body_containing_problemdetails_element_containing_type_element_set_to, + 'Check RL Response Body Containing ProblemDetails Element Containing Title Element': + Checks.check_rl_response_body_containing_problemdetails_element_containing_title_element, + 'Check JSON Value In Response Body': + Checks.check_json_value_in_response_body, + 'Check Pagination Prev And Next Headers': + Checks.check_pagination_prev_and_next_headers, + 'Check Created Resource Set To': + Checks.check_created_resource_set_to, + 'Check Updated Resource Set To': + Checks.check_updated_resource_set_to, + 'Check Updated Resources Set To': + Checks.check_updated_resources_set_to, + 'Check SUT Not Containing Resource': + Checks.check_sut_not_containing_resource, + 'Check SUT Not Containing Resources': + Checks.check_sut_not_containing_resources, + 'Check NotificationParams': + Checks.check_notificationparams, + 'Check Response Body Containing Batch Operation Result': + Checks.check_response_body_containing_batch_operation_result, + 'Wait for notification': + Checks.wait_for_notification, + 'Wait for no notification': + Checks.wait_for_no_notification, + 'Wait for notification and validate it': + Checks.wait_for_notification_and_validate_it, + 'Should be Equal': + Checks.should_be_equal, + 'Dictionary Should Contain Key': + Checks.dictionary_should_contain_key, + 'Should Not Be Empty': + Checks.should_not_be_empty, + 'Should be True': + Checks.should_be_true, + 'Check Response Body Content': + Checks.check_response_body_content, + 'Check Retrieving Context Source Registration': + Checks.check_retrieving_context_source_registration + } + + self.args = { + 'Check Response Status Code': { + 'params': ['status_code'], + 'position': [0] + }, + 'Check Response Body Containing Array Of URIs set to': { + 'params': ['expected_entities_ids', 'response_body'], + 'position': [0, 1] + }, + 'Check Response Body Containing ProblemDetails Element Containing Type Element set to': { + 'params': ['type'], + 'position': [1] + }, + 'Check Response Headers Containing Content-Type set to': { + 'params': ['content_type'], + 'position': [0] + }, + 'Check Updated Resource Set To': { + 'params': ['updated_resource', 'response_body', 'ignored_keys'], + 'position': [0] + }, + 'Check Response Body Containing ProblemDetails Element Containing Title Element': { + 'params': ['response_body'], + 'position': [0] + }, + 'Check Response Headers Containing URI set to': { + 'params': ['expected_entity_id', 'response_headers'], + 'position': [0, 1] + }, + 'Check Response Body Title When Using Session Request': { + 'params': ['response_body'], + 'position': [0] + }, + 'Check Response Body Containing EntityTypeInfo element': { + 'params': ['expectation_filename', 'response_body'], + 'position': [0, 1] + }, + 'Check Response Body Containing List Containing Entity Elements': { + 'params': ['expectation_filename', 'entities_ids', 'response_body', 'ignore_core_context_version'], + 'position': [] + }, + 'Check Response Body Containing List Containing Entity Elements With Different Types': { + 'params': ['filename', 'entities_representation_ids', 'response_body', 'ignore_core_context_version'], + 'position': [] + }, + 'Check Response Body Containing an Attribute set to': { + 'params': ['expected_attribute_name', 'response_body', 'expected_attribute_value'], + 'position': [] + }, + 'Check Response Body Containing Attribute element': { + 'params': ['expectation_filename', 'response_body'], + 'position': [0, 1] + }, + 'Check Response Body Containing EntityTemporal element': { + 'params': ['filename', 'temporal_entity_representation_id', 'response_body'], + 'position': [0, 1, 2] + }, + 'Check SUT Not Containing Resources': { + 'params': ['response_body'], + 'position': [0] + }, + 'Check Response Body Containing List Containing EntityTemporal elements': { + 'params': ['filename', 'entity_ids'], + 'position': [0, 1] + }, + 'Check RL Response Body Containing ProblemDetails Element Containing Title Element': { + 'params': ['response_body'], + 'position': [0] + }, + 'Check Response Body Containing List Containing Subscription elements': { + 'params': ['file', 'id', 'response'], + 'position': [0, 1, 2] + }, + 'Check Response Body Containing Number Of Entities': { + 'params': ['entity_type', 'number_entities', 'response'], + 'position': [0, 1, 2] + }, + 'Check Response Body Containing Context Source Registration element': { + 'params': ['file', 'id', 'response'], + 'position': [0, 1, 2] + }, + 'Check Response Body Containing EntityTypeList element': { + 'params': ['filename', 'response'], + 'position': [0, 1] + }, + 'Check Response Body Containing EntityType element': { + 'params': ['filename', 'response'], + 'position': [0, 1] + }, + 'Check Response Body Type When Using Session Request': { + 'params': ['type'], + 'position': [1] + }, + 'Check Created Resource Set To': { + 'params': ['created_resource', 'response_body', 'ignored_keys'], + 'position': [] + }, + 'Check Created Resources Set To': { + 'params': ['expected_resources', 'response_body', 'ignored_keys'], + 'position': [] + }, + 'Check RL Response Body Containing ProblemDetails Element Containing Type Element set to': { + 'params': ['type'], + 'position': [1] + }, + 'Check JSON Value In Response Body': { + 'params': ['key', 'value'], + 'position': [0, 1] + }, + 'Check Pagination Prev And Next Headers': { + 'params': ['previous', 'next'], + 'position': [1, 2] + }, + 'Check Updated Resources Set To': { + 'params': ['number_entities'], + 'position': [0] + }, + 'Check SUT Not Containing Resource': { + 'params': ['status_code'], + 'position': [0] + }, + 'Check NotificationParams': { + 'params': ['filename', 'expected_additional_members', 'response_body'], + 'position': [0, 1, 2] + }, + 'Check Response Body Containing Batch Operation Result': { + 'params': ['operation'], + 'position': [0] + }, + 'Should be Equal': { + 'params': ['expected_value', 'obtained_value'], + 'position': [0, 1] + }, + 'Check Response Body Containing Subscription element': { + 'params': ['filename', 'subscription_id', 'response_body'], + 'position': [0, 1, 2] + }, + 'Wait for notification': { + 'params': ['timeout'], + 'position': [] + }, + 'Wait for notification and validate it': { + 'params': ['expected_subscription_id', 'expected_context_source_registration_ids', + 'expected_trigger_reason', 'expected_notification_data_entities', + 'timeout'], + 'position': [] + }, + 'Wait for no notification': { + 'params': ['timeout'], + 'position': [] + }, + 'Check Response Body Containing AttributeList element': { + 'params': ['filename', 'response'], + 'position': [0, 1] + }, + 'Check Response Body Containing Entity element': { + 'params': ['filename', 'id', 'response'], + 'position': [0, 1, 2] + }, + 'Check Response Body Content': { + 'params': ['expectation_filename', 'response_body', 'additional_ignored_path'], + 'position': [] + }, + 'Dictionary Should Contain Key': { + 'params': ['dictionary', 'key'], + 'position': [0, 1] + }, + 'Should Not Be Empty': { + 'params': ['variable'], + 'position': [0] + }, + 'Should be True': { + 'params': ['expression'], + 'position': [0] + }, + 'Check Retrieving Context Source Registration': { + 'params': ['registration_id', 'context', 'accept', 'registration_payload'], + 'position': [0, 1, 2, 3] + } + } + + @staticmethod + def check_response_status_code(kwargs: list) -> str: + if "status_code" in kwargs: + status_code = kwargs['status_code'] + try: + return f'Response Status Code set to {status_code} ({HTTPStatus(status_code).phrase})' + except ValueError: + return f'Response Status Code set to {status_code}' + else: + raise Exception(f'ERROR, Expected status_code parameter but received: {kwargs}') + + @staticmethod + def wait_for_notification(kwargs: list) -> str: + if 'timeout' in kwargs and kwargs['timeout'] != '': + result = f"After waiting '{kwargs['timeout']}' seconds" + else: + result = f"After waiting '5' seconds" + + return result + + @staticmethod + def wait_for_notification_and_validate_it(kwargs: list) -> str: + expected_parameters = ['expected_subscription_id', 'expected_context_source_registration_ids', + 'expected_trigger_reason', 'expected_notification_data_entities', + 'timeout'] + + if 'expected_notification_data_entities' not in kwargs: + kwargs['expected_notification_data_entities'] = "${EMPTY}" + + if 'timeout' not in kwargs: + kwargs['timeout'] = '5' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Waiting for Notification and validate it" + for key, value in kwargs.items(): + match key: + case 'expected_subscription_id': + response = f"{response} and\n Query Parameter: expected_subscription_id set to '{value}'" + case 'expected_context_source_registration_ids': + response = f"{response} and\n Query Parameter: expected_context_source_registration_ids set to '{value}'" + case 'expected_trigger_reason': + response = f"{response} and\n Query Parameter: expected_trigger_reason set to '{value}'" + case 'expected_notification_data_entities': + response = f"{response} and\n Query Parameter: expected_notification_data_entities set to '{value}'" + case 'timeout': + response = f"{response} and\n Query Parameter: timeout set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def wait_for_no_notification(kwargs: list) -> str: + expected_parameters = ['timeout'] + + if 'timeout' not in kwargs: + kwargs['timeout'] = '5' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Waiting for no Notification data" + for key, value in kwargs.items(): + match key: + case 'timeout': + response = f"{response} and\n Query Parameter: timeout set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_response_body_containing_array_of_uris_set_to(kwargs: list) -> str: + return 'Response Body set to an array of created entities ids' + + @staticmethod + def check_created_resources_set_to(kwargs: list) -> str: + return 'Created resources set to ${entities}' + + @staticmethod + def dictionary_should_contain_key(kwargs: list) -> str: + if 'dictionary' in kwargs and 'key' in kwargs: + return f"The dictionary `{kwargs['dictionary']}' should contain the key '{kwargs['key']}'" + else: + raise Exception(f'ERROR, Expected dictionary and key parameters but received: {kwargs}') + + @staticmethod + def should_not_be_empty(kwargs: list) -> str: + if 'variable' in kwargs: + return f"The variable `{kwargs['variable']}' should not be '${{EMPTY}}'" + else: + raise Exception(f'ERROR, Expected dictionary and key parameters but received: {kwargs}') + + @staticmethod + def should_be_true(kwargs: list) -> str: + if 'expression' in kwargs: + return f"The expression `{kwargs['expression']}' should be True" + else: + raise Exception(f'ERROR, Expected dictionary and key parameters but received: {kwargs}') + + @staticmethod + def check_response_headers_containing_content_type_set_to(kwargs: list) -> str: + if "content_type" in kwargs: + content_type = kwargs['content_type'] + return f'Response Header: Content-Type set to {content_type}' + else: + raise Exception(f'ERROR, Expected status_code parameter but received: {kwargs}') + + @staticmethod + def check_response_headers_link_not_empty(kwargs: list) -> str: + return f'Response Header: Link is not Empty' + + @staticmethod + def check_response_headers_containing_uri_set_to(kwargs: list) -> str: + if 'expected_entity_id' in kwargs and 'response_headers' in kwargs: + return f"Response Header: Location containing ${kwargs['expected_entity_id']}" + else: + raise Exception(f'ERROR, Expected expected_entity_id and response_headers parameters ' + f'but received: {kwargs}') + + @staticmethod + def check_response_headers_id_not_empty(kwargs: list) -> str: + return 'Response Header: Location is not Empty' + + @staticmethod + def check_response_body_containing_an_attribute_set_to(kwargs: list) -> str: + expected_parameters = ['checks', 'expected_attribute_name', 'response_body', 'expected_attribute_value'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Response Body containing an Attribute set to" + for key, value in kwargs.items(): + match key: + case 'expected_attribute_name': + response = f"{response} and\n Query Parameter: expected_attribute_name set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: response_body set to '{value}'" + case 'expected_attribute_value': + response = f"{response} and\n Query Parameter: expected_attribute_value set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_response_body_containing_entity_element(kwargs: list) -> str: + if 'filename' in kwargs and 'id' in kwargs and 'response' in kwargs: + return f"Response Body containing en entity element with id set to '{kwargs['id']}' and body content set to '{kwargs['filename']}'" + + @staticmethod + def check_response_body_containing_list_containing_entity_elements(kwargs: list) -> str: + expected_parameters = ['expectation_filename', 'entities_ids', 'response_body', 'ignore_core_context_version'] + + if 'ignore_core_context_version' not in kwargs: + kwargs['ignore_core_context_version'] = False + + result = [x for x in kwargs if x not in expected_parameters] + response = "Response Body containing a list containing Entity Elements" + for key, value in kwargs.items(): + match key: + case 'expectation_filename': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'entities_ids': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'ignore_core_context_version': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_response_body_containing_list_containing_entity_elements_with_different_types(kwargs: list) -> str: + expected_parameters = ['filename', 'entities_representation_ids', 'response_body', 'ignore_core_context_version'] + + if 'ignore_core_context_version' not in kwargs: + kwargs['ignore_core_context_version'] = False + + result = [x for x in kwargs if x not in expected_parameters] + response = "Response body containing a list containing entity elements with different types" + for key, value in kwargs.items(): + match key: + case 'filename': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'entities_representation_ids': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'ignore_core_context_version': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_retrieving_context_source_registration(kwargs: list) -> str: + expected_parameters = ['registration_id', 'context', 'accept', 'registration_payload'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Retrieving Context Source Registration" + for key, value in kwargs.items(): + match key: + case 'registration_id': + response = f"{response} and\n Query Parameter: registration_id set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'registration_payload': + response = f"{response} and\n Query Parameter: registration_payload set to '{value}'" + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_response_body_containing_entitytemporal_element(kwargs: list) -> str: + if 'filename' in kwargs and 'temporal_entity_representation_id' in kwargs and 'response_body' in kwargs: + return (f"Response Body containing EntityTemporal element containing attribute instances in the time range" + f" specified by the NGSI-LD temporal query:\n" + f" * the payload is defined in the file set to '{kwargs['filename']}'\n" + f" * the id was changed to '{kwargs['temporal_entity_representation_id']}'\n" + f" * response body to be checked set to '{kwargs['response_body']}'") + else: + raise Exception(f"ERROR, expected 'filename', 'temporal_entity_representation_id', and 'response_body' " + f"attributes, received: '{kwargs}'") + + @staticmethod + def check_response_body_containing_list_containing_entitytemporal_elements(kwargs: list) -> str: + if 'filename' in kwargs and 'entity_ids' in kwargs: + return (f"Request response body containing a list that contains Entity Temporal Elements\n" + f" compared with file '{kwargs['filename']}'\n" + f" and using the list of entity ids define in '{kwargs['entity_ids']}'") + else: + raise Exception(f"ERROR, expected parameters 'filename' and 'entity_ids', but received '{kwargs}'") + + @staticmethod + def check_response_body_containing_subscription_element(kwargs: list) -> str: + if 'filename' in kwargs and 'subscription_id' in kwargs and 'response_body' in kwargs: + return (f"Response Body containing the same content defined in file '{kwargs['filename']}'" + f" with subscription id '{kwargs['subscription_id']}'") + else: + raise Exception(f"ERROR, expected parameters 'filename' and 'entity_ids', but received '{kwargs}'") + + @staticmethod + def check_response_body_containing_list_containing_subscription_elements(kwargs: list) -> str: + if 'file' in kwargs and 'id' in kwargs and 'response' in kwargs: + return (f"Response containing:\n" + f" * file set to '{kwargs['file']}'\n" + f" * id set to '{kwargs['id']}'\n" + f" * response set to '{kwargs['response']}'") + else: + raise Exception(f"ERROR, expected 'file', 'id', and 'response' attributes, received: '{kwargs}'") + + @staticmethod + def check_response_body_containing_number_of_entities(kwargs: list) -> str: + if "entity_type" in kwargs and 'number_entities' in kwargs and 'response' in kwargs: + number_entities = kwargs['number_entities'] + entity_type = kwargs['entity_type'] + response = kwargs['response'] + return (f"Response Body containing a list of entities equal to '{number_entities}' of type '{entity_type}' " + f"with response set to '{response}'") + else: + raise Exception(f'ERROR, expected entity_type and number_entities attributes, but received: {kwargs}') + + @staticmethod + def check_response_body_containing_context_source_registration_element(kwargs: list) -> str: + if 'file' in kwargs and 'id' in kwargs and 'response' in kwargs: + return (f"Response containing:\n" + f" * file set to '{kwargs['file']}'\n" + f" * id set to '{kwargs['id']}'\n" + f" * response set to '{kwargs['response']}'") + else: + raise Exception(f"ERROR, expected 'file', 'id', and 'response' attributes, received: '{kwargs}'") + # if 'csr_description' in kwargs: + # csr = kwargs['csr_description'] + # return f"Response body containing a '{csr}'" + # else: + # raise Exception(f"ERROR, expected csr_description attribute, but received: {kwargs}") + + @staticmethod + def check_response_body_containing_entitytypelist_element(kwargs: list) -> str: + if 'filename' in kwargs and 'response' in kwargs: + return f"Response Body containing an Entity Type List with expectation body equal to file: '{kwargs['filename']}'" + else: + raise Exception(f"ERROR, expected filename and response attributes, but received: {kwargs}") + + @staticmethod + def check_response_body_containing_entitytype_element(kwargs: list) -> str: + if 'filename' in kwargs and 'response' in kwargs: + return f"Response Body containing an Entity Type Element with expectation body equal to file: '{kwargs['filename']}'" + else: + raise Exception(f"ERROR, expected filename and response attributes, but received: {kwargs}") + + @staticmethod + def check_response_body_containing_entitytypeinfo_element(kwargs: list) -> str: + if 'expectation_filename' in kwargs and 'response_body' in kwargs: + return (f"Response body containing an Entity Type Info " + f"with expectation body set to file '{kwargs['expectation_filename']}' " + f"and response body to be checked set to '{kwargs['response_body']}'") + else: + raise Exception(f"ERROR, expected filename and response attributes, but received: {kwargs}") + + @staticmethod + def check_response_body_containing_attributelist_element(kwargs: list) -> str: + if 'filename' in kwargs and 'response' in kwargs: + return (f"Response Body containing an Attribute List element" + f"\n * with filename set to '{kwargs['filename']}'" + f"\n * response set to '{kwargs['response']}'") + + @staticmethod + def check_response_body_containing_attribute_element(kwargs: list) -> str: + if 'expectation_filename' in kwargs and 'response_body' in kwargs: + return (f"Response body containing an array of attributes" + f"\n * with the expected payload defined in the file '{kwargs['expectation_filename']}'" + f"\n * and response body set to '{kwargs['response_body']}'") + + @staticmethod + def check_response_body_containing_list_containing_context_source_registrations_elements(kwargs: list) -> str: + return 'Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context' + + @staticmethod + def check_response_body_type_when_using_session_request(kwargs: list) -> str: + if 'type' in kwargs: + type = kwargs['type'] + return f"Response Body containing the type '{type}'" + else: + raise Exception(f"ERROR, expected type attribute, but received: {kwargs}") + + @staticmethod + def check_response_body_containing_problemdetails_element_containing_type_element_set_to(kwargs: list) -> str: + if 'type' in kwargs: + type = kwargs['type'] + return f"Response Body containing the type '{type}'" + else: + raise Exception(f"ERROR, expected type attribute, but received: {kwargs}") + + @staticmethod + def check_response_body_title_when_using_session_request(kwargs: list) -> str: + return "Response body containing 'title' element" + + @staticmethod + def check_response_body_containing_problemdetails_element_containing_title_element(kwargs: list) -> str: + return "Response body containing 'title' element" + + @staticmethod + def check_rl_response_body_containing_problemdetails_element_containing_type_element_set_to(kwargs: list) -> str: + if 'type' in kwargs: + type = kwargs['type'] + return f"Response Body containing the type '{type}'" + else: + raise Exception(f"ERROR, expected type attribute, but received: {kwargs}") + + @staticmethod + def check_rl_response_body_containing_problemdetails_element_containing_title_element(kwargs: list) -> str: + return "Response body containing 'title' element" + + @staticmethod + def check_json_value_in_response_body(kwargs: list) -> str: + if 'key' in kwargs and 'value' in kwargs: + key = kwargs['key'] + value = kwargs['value'] + return f"Response Body containing the key '{key}', with the value '{value}'" + else: + raise Exception(f"ERROR, expected key and value attributes, but received: {kwargs}") + + @staticmethod + def check_pagination_prev_and_next_headers(kwargs: list) -> str: + previous = None + next = None + if 'previous' in kwargs: + previous = kwargs['previous'] + previous_text = f"with 'Prev' header equal to '{previous}'" + + if 'next' in kwargs: + next = kwargs['next'] + next_text = f"with 'Next' header equal to '{next}'" + + if previous is None and next is None: + raise Exception(f"ERROR, expected previous or next attributes, but received: {kwargs}") + elif previous is not None and next is None: + result = f"Response header {previous_text}" + elif previous is None and next is not None: + result = f"Response header {next_text}" + else: + result = f"Response header {previous_text} and {next_text}" + + return result + + @staticmethod + def check_created_resource_set_to(kwargs: list) -> str: + expected_parameters = ['created_resource', 'response_body', 'ignored_keys'] + + if 'ignored_keys' not in kwargs: + kwargs['ignored_keys'] = '${None}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Created Resource Set To" + for key, value in kwargs.items(): + match key: + case 'created_resource': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'ignored_keys': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_created_resources_set_to(kwargs: list) -> str: + expected_parameters = ['expected_resources', 'response_body', 'ignored_keys'] + + if 'ignored_keys' not in kwargs: + kwargs['ignored_keys'] = '${None}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Created Resource Set To" + for key, value in kwargs.items(): + match key: + case 'expected_resources': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'ignored_keys': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_updated_resource_set_to(kwargs: list) -> str: + return "Updated Entity set to ${entity}" + + @staticmethod + def check_updated_resources_set_to(kwargs: list) -> str: + if 'number_entities' in kwargs: + number_entities = kwargs['number_entities'] + return f"Updated Entities set to '{number_entities}' valid entities" + + @staticmethod + def check_sut_not_containing_resource(kwargs: list) -> str: + if "status_code" in kwargs: + status_code = kwargs['status_code'] + try: + return f'Response Status Code set to {status_code} ({HTTPStatus(status_code).phrase})' + except ValueError: + return f'Response Status Code set to {status_code}' + else: + raise Exception(f'ERROR, Expected status_code parameter but received: {kwargs}') + + @staticmethod + def check_sut_not_containing_resources(kwargs: list) -> str: + return f'Response body is empty' + + @staticmethod + def check_notificationparams(kwargs: list) -> str: + if 'filename' in kwargs and 'expected_additional_members' in kwargs and 'response_body' in kwargs: + return (f"Response containing:\n" + f" * Notification expectation file path set to '{kwargs['filename']}'\n" + f" * Expected Additional Members set to '{kwargs['expected_additional_members']}'\n" + f" * Response Body set to '{kwargs['response_body']}'\n") + else: + raise Exception(f"ERROR, expected 'filename', 'expected_additional_members', and 'response_body', " + f"but received '{kwargs}'") + + @staticmethod + def check_response_body_containing_batch_operation_result(kwargs: list) -> str: + if "operation" in kwargs: + return f"Response body containing batch operation result set to '{kwargs['operation']}'" + else: + raise Exception(f'ERROR, Expected operation parameter but received: {kwargs}') + + @staticmethod + def check_response_body_content(kwargs: list) -> str: + expected_parameters = ['expectation_filename', 'response_body', 'additional_ignored_path'] + + if 'additional_ignored_path' not in kwargs: + kwargs['additional_ignored_path'] = '${EMPTY}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Response Body Content" + for key, value in kwargs.items(): + match key: + case 'expectation_filename': + response = f"{response} and\n Query Parameter: expectation_filename set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: response_body set to '{value}'" + case 'additional_ignored_path': + response = f"{response} and\n Query Parameter: additional_ignored_path set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + + @staticmethod + def should_be_equal(kwargs: list) -> str: + if 'expected_value' in kwargs and 'obtained_value' in kwargs: + return f"Notification data: '{kwargs['obtained_value']}' equal to '{kwargs['expected_value']}'" + else: + raise Exception(f"ERROR, Expected 'expected_value' and 'obtained_value' parameters but received: '{kwargs}'") + + def get_checks(self, **kwargs) -> str: + checking = None + + if "checks" in kwargs: + checking = kwargs["checks"] + else: + raise Exception(f'ERROR, the attribute checks is mandatory, but received: {kwargs}') + + if isinstance(checking, str): + result = self.checks[checking](kwargs) + elif isinstance(checking, list): + result = [self.checks[x](kwargs) for x in checking] + result = " and\n".join(result) + else: + raise Exception(f"ERROR, checks type not supported: {checking}") + + return result + + +if __name__ == "__main__": + data = Checks() + + print(data.get_checks(checks='Check Response Status Code', + status_code=201)) + print(data.get_checks(checks='Check Response Body Containing Array Of URIs set to')) + print(data.get_checks(checks='Check Created Resources Set To')) + print(data.get_checks(checks='Check Response Headers Containing Content-Type set to', + content_type='application/json')) + print(data.get_checks(checks='Check Response Headers Link Not Empty')) + print(data.get_checks(checks='Check Response Headers Containing URI set to')) + print(data.get_checks(checks='Check Response Headers ID Not Empty')) + print(data.get_checks(checks='Check Response Body Containing an Attribute set to', + attribute_name='status')) + print(data.get_checks(checks='Check Response Body Containing an Attribute set to', + attribute_name='status', + attribute_value='active')) + print(data.get_checks(checks='Check Response Body Containing Entity element')) + print(data.get_checks(checks='Check Response Body Containing List Containing Entity Elements')) + print(data.get_checks(checks='Check Response Body Containing List Containing Entity Elements With Different Types')) + print(data.get_checks(checks='Check Response Body Containing EntityTemporal element')) + print(data.get_checks(checks='Check Response Body Containing List Containing EntityTemporal elements', + timeRel='after', + timeAt='2020-07-01T12:05:00Z')) + print(data.get_checks(checks='Check Response Body Containing Subscription element')) + print(data.get_checks(checks='Check Response Body Containing List Containing Subscription elements', + number=2)) + print(data.get_checks(checks='Check Response Body Containing List Containing Subscription elements', + number=1)) + print(data.get_checks(checks='Check Response Body Containing Number Of Entities', + entity_type="Vehicle", + number_entities=3)) + print(data.get_checks(checks='Check Response Body Containing Context Source Registration element', + csr_description='Context Source Registration')) + print(data.get_checks(checks='Check Response Body Containing EntityTypeList element', + description='Json object with list of entity types with context')) + print(data.get_checks(checks='Check Response Body Containing EntityType element', + description='Json object with an entity type with context')) + print(data.get_checks(checks='Check Response Body Containing EntityTypeInfo element')) + print(data.get_checks(checks='Check Response Body Containing AttributeList element')) + print(data.get_checks(checks='Check Response Body Containing Attribute element')) + print(data.get_checks(checks='Check Response Body Containing List Containing Context Source Registrations elements')) + print(data.get_checks(checks='Check Response Body Type When Using Session Request', + type='https://uri.etsi.org/ngsi-ld/errors/BadRequestData')) + print(data.get_checks(checks='Check Response Body Containing ProblemDetails Element Containing Type Element set to', + type='https://uri.etsi.org/ngsi-ld/errors/BadRequestData')) + print(data.get_checks(checks='Check Response Body Title When Using Session Request')) + print(data.get_checks(checks='Check Response Body Containing ProblemDetails Element Containing Title Element')) + print(data.get_checks(checks='Check RL Response Body Containing ProblemDetails Element Containing Type Element set to', + type='https://uri.etsi.org/ngsi-ld/errors/BadRequestData')) + print(data.get_checks(checks='Check RL Response Body Containing ProblemDetails Element Containing Title Element')) + print(data.get_checks(checks='Check JSON Value In Response Body', + key="['information']['entities'][0]['type']", + value="Building")) + print(data.get_checks(checks='Check Pagination Prev And Next Headers', + previous=';rel="prev";type="application/ld+json"', + next=';rel="next";type="application/ld+json"')) + print(data.get_checks(checks='Check Pagination Prev And Next Headers', + previous='', + next=';rel="next";type="application/ld+json"')) + print(data.get_checks(checks='Check Pagination Prev And Next Headers', + previous=';rel="prev";type="application/ld+json"', + next='')) + print(data.get_checks(checks='Check Pagination Prev And Next Headers', + previous='', + next='')) + print(data.get_checks(checks='Check Created Resource Set To')) + print(data.get_checks(checks='Check Updated Resource Set To')) + print(data.get_checks(checks='Check Updated Resources Set To', + number_entities=2)) + print(data.get_checks(checks='Check SUT Not Containing Resource', + status_code=404)) + print(data.get_checks(checks='Check SUT Not Containing Resources')) + print(data.get_checks(checks='Check NotificationParams', + format="keyValues", + uri="http://my.endpoint.org/notify", + accept="application/json", + status="ok", + timesSent="1")) + + print() + print(data.get_checks(checks= + ['Check Response Status Code', + 'Check Response Body Containing Array Of URIs set to', + 'Check Created Resources Set To'] + , status_code=201)) + print() + + # Check exceptions + try: + print(data.get_checks(checks='Check Response Body Containing an Attribute set to')) + except Exception as e: + print(e) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py new file mode 100644 index 0000000000000000000000000000000000000000..65a6d527ea58b11c603c3e677a0d0059b5c921f3 --- /dev/null +++ b/doc/analysis/generaterobotdata.py @@ -0,0 +1,568 @@ +from os.path import dirname +from robot.api import TestSuiteBuilder +from analysis.parserobotfile import ParseRobotFile +from analysis.parseapiutilsfile import ParseApiUtilsFile +from analysis.parsevariablesfile import ParseVariablesFile +from analysis.initial_setup import InitialSetup +from re import match, findall, finditer, sub, MULTILINE + + +class GenerateRobotData: + def __init__(self, robot_file: str, execdir: str): + self.robot_file = robot_file + self.execdir = execdir + self.suite = TestSuiteBuilder().build(robot_file) + + self.config_variables = ParseVariablesFile() + self.robot = ParseRobotFile(filename=robot_file, execdir=execdir, config_file=self.config_variables) + # TODO: the robot file can provide several ApiUtils not only one + self.apiutils = [ParseApiUtilsFile(filename=file) for file in self.robot.resource_files] + self.robot.set_apiutils(self.apiutils) + + self.test_cases = list() + self.test_suite = dict() + self.tags_template = list() + self.documentation_template = str() + self.arguments = list() + self.args = list() + self.identifier = { + 'ContextInformation': 'CI', + 'CommonBehaviours': 'CB', + 'Consumption': 'Cons', + 'Provision': 'Prov', + 'ContextSource': 'CS', + 'Discovery/RetrieveAvailableAttributeInformation': 'DISC', + 'Discovery/RetrieveAvailableEntityTypeInformation': 'DISC', + 'Discovery/RetrieveAvailableEntityTypes': 'DISC', + 'Discovery/RetrieveDetailsOfAvailableEntityTypes': 'DISC', + 'Discovery/RetrieveAvailableAttributes': 'DISC', + 'Discovery/RetrieveDetailsOfAvailableAttributes': 'DISC', + 'Entity/RetrieveEntity': 'E', + 'Entities/CreateEntity': 'E', + 'Entity/QueryEntities': 'E', + 'Entities/DeleteEntity': 'E', + 'EntityAttributes/AppendEntityAttributes': 'EA', + 'EntityAttributes/UpdateEntityAttributes': 'EA', + 'EntityAttributes/PartialAttributeUpdate': 'EA', + 'EntityAttributes/DeleteEntityAttribute': 'EA', + 'BatchEntities/CreateBatchOfEntities': 'BE', + 'BatchEntities/UpsertBatchOfEntities': 'BE', + 'BatchEntities/UpdateBatchOfEntities': 'BE', + 'BatchEntities/DeleteBatchOfEntities': 'BE', + 'TemporalEntity/QueryTemporalEvolutionOfEntities': 'TE', + 'TemporalEntity/DeleteTemporalRepresentationOfEntity': 'TE', + 'TemporalEntity/UpdateTemporalRepresentationOfEntity': 'TE', + 'TemporalEntity/RetrieveTemporalEvolutionOfEntity': 'TE', + 'TemporalEntity/CreateTemporalRepresentationOfEntity': 'TE', + 'TemporalEntityAttributes/DeleteAttributeInstance': 'TEA', + 'TemporalEntityAttributes/DeleteAttribute': 'TEA', + 'TemporalEntityAttributes/PartialUpdateAttributeInstance': 'TEA', + 'TemporalEntityAttributes/AddAttributes': 'TEA', + 'Subscription/CreateSubscription': 'SUB', + 'Subscription/DeleteSubscription': 'SUB', + 'Subscription/QuerySubscriptions': 'SUB', + 'Subscription/RetrieveSubscription': 'SUB', + 'Subscription/UpdateSubscription': 'SUB', + 'Subscription/SubscriptionNotificationBehaviour': 'SUB', + 'Registration/CreateContextSourceRegistration': 'REG', + 'Registration/CreateCSRegistration': 'REG', + 'Registration/UpdateCSRegistration': 'REG', + 'Registration/DeleteCSRegistration': 'REG', + 'Registration/RegisterCS': 'CSR', + 'RegistrationSubscription/CreateCSRegistrationSubscription': 'REGSUB', + 'RegistrationSubscription/UpdateCSRegistrationSubscription': 'REGSUB', + 'RegistrationSubscription/RetrieveCSRegistrationSubscription': 'REGSUB', + 'RegistrationSubscription/QueryCSRegistrationSubscriptions': 'REGSUB', + 'RegistrationSubscription/DeleteCSRegistrationSubscription': 'REGSUB', + 'RegistrationSubscription/CSRegistrationSubscriptionNotificationBehaviour': 'REGSUB', + 'RegistrationSUBBehaviour': 'REGSUB', + 'Discovery/RetrieveCSRegistration': 'DISC', + 'Discovery/QueryCSRegistrations': 'DISC', + 'CommonResponses/VerifyLdContextNotAvailable': 'HTTP', + 'CommonResponses/VerifyMergePatchJson': 'HTTP', + 'CommonResponses/VerifyGETWithoutAccept': 'HTTP', + 'CommonResponses/VerifyUnsupportedMediaType': 'HTTP', + 'CommonResponses/VerifyNotAcceptableMediaType': 'HTTP' + } + self.references = { + 'v1.3.1': 'ETSI GS CIM 009 V1.3.1 [], clause ' + } + self.initial_conditions = { + 'Setup Initial Entity': + 'with {\n the SUT containing an initial Entity ${entity} with an id set to ${entityId}\n}', + 'Initial State': + 'with {\n the SUT in the "initial state"\n}' + } + self.headers = { + '${CONTENT_TYPE_LD_JSON}': 'Content-Type' + } + self.ids = { + '${ENTITIES_ENDPOINT_PATH}': '${entityId}' + } + self.base_TP_id = str() + + self.initial_setup = InitialSetup() + + + def get_info(self): + self.test_suite['robotpath'] = (self.robot_file.replace(f'{self.execdir}/TP/NGSI-LD/', '') + .replace(f'/{self.robot.test_suite}.robot', '')) + self.test_suite['robotfile'] = self.robot.test_suite + return self.test_suite + + def parse_robot(self): + self.start_suite() + _ = [self.visit_test(test=x) for x in self.suite.tests] + + _ = [self.get_step_data(test=x.name) for x in self.suite.tests] + self.test_suite['test_cases'] = self.test_cases + + # Generate the permutation keys to provide the keys in test_cases list that are different + self.test_suite['permutations'] = self.get_permutation_keys(data=self.test_suite['test_cases']) + + # Generate the initial_condition of the test suite + self.test_suite['initial_condition'] = self.generate_initial_condition() + + def generate_initial_condition(self) -> str : + aux = [x['setup'] for x in self.test_cases] + if all(element == aux[0] for element in aux[1:]): + aux = self.initial_setup.get_initial_condition(initial_condition=aux[0]) + return aux + else: + print(f'Something went wrong, the test suite {self.suite.resource.source} ' + f'has different "setup" values for its test cases.') + + def get_permutation_keys(self, data): + all_keys = set().union(*data) + excluded_keys = ['doc', 'permutation_tp_id', 'setup', 'teardown', 'name', 'tags'] + all_keys = [x for x in all_keys if x not in excluded_keys] + + keys_with_different_values = [ + key for key in all_keys if any(d.get(key) != data[0].get(key) for d in data[1:]) + ] + + keys_with_different_values.sort() + + return keys_with_different_values + + def get_data_template(self, string: str) -> str: + if self.robot.test_template_name != '': + result = self.robot.string_test_template + else: + result = string + + return result + + def get_params(self, test_case: str): + test_case = self.get_data_template(string=test_case) + lines_starting_response = findall(r'^\s*\$\{response\}.*|^\s*\$\{notification\}.*', test_case, MULTILINE) + + # If there is more than one line, it means that the test case has several operations, all of them to + # create the environment content to execute the last one, which is the correct one to test the Test Case + if (len(lines_starting_response) > 1 and + any(map(lambda item: 'notification' in item, lines_starting_response)) is False): + # The last one corresponds to the execution of the test, the rest corresponds to the initial condition of + # test case... + response_to_check = lines_starting_response[-1] + else: + response_to_check = lines_starting_response[0] + + index = test_case.find(response_to_check) + aux = test_case[index:].split('\n') + aux = [x for x in aux if x != ''] + + params = list() + request = str() + + # Get the list of params of the function, they are the keys + if ' ... ' in aux[1]: + request = aux[0].split(' ') + request = [x for x in request if x != ''][1] + + # We are in the case that the attributes are in following lines + for i in range(1, len(aux)): + if ' ... ' in aux[i]: + regex = '(\s{4})*\s{4}\.{3}\s{4}(.*)' + param = match(pattern=regex, string=aux[i]) + if aux: + params.append(param.groups()[1]) + else: + break + else: + # the attributes are in the same line + regex = r"\s*\$\{response\}=\s{4}(.*)" + matches = finditer(regex, response_to_check, MULTILINE) + request = aux[0].split(' ')[2] + + # We have two options from here, or the parameters are defined in the same line or the parameters are defined in + # following lines, next lines + for a_match in matches: + # Check that we have 1 group matched + if len(a_match.groups()) == 1: + aux = a_match.group(1) + + # Get the list of keys + params = aux.split(' ')[1:] + else: + raise Exception(f"Error, unexpected format, received: '{response_to_check}'") + + return request, params + + def get_step_data(self, test: str): + if self.robot.string_test_template == '': + string = self.robot.test_cases[test] + else: + string = self.robot.string_test_template + + request, params = self.get_params(test_case=string) + + for data in self.apiutils: + verb, url, query_param = data.get_response(keyword=request) + if verb != '': + break + + index = None + for i, item in enumerate(self.test_cases): + if 'name' in item and item['name'] == test: + index = i + break + + self.test_cases[index]['http_verb'] = verb + self.test_cases[index]['endpoint'] = self.get_values_url(keys=url, + query_param=query_param, + request=request, + params=params) + + self.test_cases[index]['when'] = self.robot.generate_when_content(http_verb=self.test_cases[index]['http_verb'], + endpoint=self.test_cases[index]['endpoint'], + when=self.test_cases[index]['when']) + + def check_header_parameters(self, params: list, test: str): + value = str() + + # 1st case: value of the parameters are sent as it is + header_key = [x for x in params if x in self.headers.keys()] + if len(header_key) != 0: + key = header_key[0] + value = self.get_header_value(key=key) + else: + # 2nd case, maybe the params are defined in the way = + for k in self.headers: + aux = [x for x in params if k in x] + + if len(aux) != 0: + key = aux[0].split('=')[1] + value = self.get_header_value(key=key) + else: + key = None + value = None + + if key is not None and value is not None: + # Iterate over the list and find the index + index = None + for i, item in enumerate(self.test_cases): + if 'name' in item and item['name'] == test: + index = i + break + + # self.test_cases[index]['params'] = params + self.test_cases[index][self.headers[key]] = value + + def get_values_url(self, keys: list, query_param: bool, request: str, params: list) -> str: + data = [self.get_value_url(key=x, request=request, params=params) for x in keys] + + if query_param == False: + data = '/'.join(data).replace('//', '/').replace('?/','?') + else: + aux = '/'.join(data[:-1]).replace('//', '/').replace('?/','?') + data = f"{aux}?{data[-1]}" + + return data + + def get_value_url(self, key: str, request: str, params: list) -> str: + key_to_search = f'${key}' + try: + flattened_list_variables = {k: v for d in self.apiutils for k, v in d.variables.items()} + value = flattened_list_variables[key_to_search] + except KeyError: + # It is not defined in ApiUtils, maybe in Robot File? + try: + value = self.robot.variables[key_to_search] + except KeyError: + # Maybe the url is defined in the proper resource file through an operation + try: + value = self.check_resource_for_url(string=key_to_search, request=request, params=params) + except KeyError: + # The variable is not defined, so it is keep as it is in the url + value = key + + return value + + def check_resource_for_url(self, string: str, request: str, params: list) -> str: + data_file_contents = '\n'.join([x.file_contents for x in self.apiutils]) + flattened_list_variables = {k: v for d in self.apiutils for k, v in d.variables.items()} + flattened_list_variables = {key.split(' ')[0]: value for key, value in flattened_list_variables.items()} + + index1 = data_file_contents.find(string) + + if index1 != -1: + index2 = data_file_contents[index1:].find("\n") + line = data_file_contents[index1:index1 + index2] + + if string in line: + if 'Get From Dictionary' in line: + # We have to obtain the information of the endpoint from the dictionary + aux = line.split("Get From Dictionary")[1].strip().split(" ") + key = aux[0] + value = aux[1] + url_dict = flattened_list_variables[key] + + if request == 'Batch Request Entities From File': + url = url_dict[params[0]] + else: + raise KeyError + + return url + else: + raise KeyError + else: + raise KeyError + else: + raise KeyError + + def get_header_value(self, key: str): + value = str() + # We can have a simple variable or a compound of two variables + count = key.count('$') + if count == 1: + # Get the value of the Header key + try: + value = self.apiutils.variables[key] + except KeyError: + # It is not defined in ApiUtils, maybe in Robot File + try: + value = self.robot.variables[key] + except KeyError: + # ERROR, the header key is not defined + raise Exception(f"ERROR, the header key '{key}' is undefined") + elif count == 2: + keys = key.split("$") + key = f'${keys[1]}' + second_key = f'${keys[2]}' + + try: + second_key = self.ids[key] + except KeyError: + raise Exception(f"ERROR: Need to manage the '{second_key}' in GenerateRobotData::self.ids") + # Get the value of the Header key + try: + value = self.apiutils.variables[key] + value = f'{value}{second_key}' + except KeyError: + # It is not defined in ApiUtils, maybe in Robot File + try: + value = self.robot.variables[key] + value = f'{value}{second_key}' + except KeyError: + # ERROR, the header key is not defined + raise Exception(f"ERROR, the header key '{key}' is undefined") + + return value + + def start_suite(self): + """Modify suite's tests to contain only every Xth.""" + version = 'v1.3.1' + tp_id = self.generate_name() + reference, pics = self.generate_reference(version=version) + + self.test_suite = { + 'tp_id': tp_id, + 'test_objective': self.suite.doc, + 'reference': reference, + 'config_id': str(), + 'parent_release': version, + 'pics_selection': pics, + 'keywords': [str(x) for x in self.suite.keywords], + 'teardown': str(self.suite.teardown), + 'initial_condition': str(), + 'test_cases': list() + } + + def visit_test(self, test): + # Get Tags associated to the test + if len(test.tags) == 0 and self.tags_template is not None: + tags = self.tags_template + else: + tags = list(test.tags) + + # Get the Documentation associated to the test + if len(test.doc) == 0 and len(self.documentation_template) != 0: + documentation = self.documentation_template + else: + documentation = test.doc + + # Get the Content-Type and Body associated to the Test + if len(self.args) != 0: + # We are talking about Test Cases with Test Template, so we need to check the keyword content with the + # definition of the template + + # Generate Checks for Test Data + then = self.robot.get_checks(test_name=test.template, apiutils=self.apiutils, name=test.name) + + # Generate Request for Test Data + when = self.robot.get_request(test_name=test.template, name=test.name) + else: + # We are talking about a Test Cases without Test Template + # Generate Checks for Test Data + then = self.robot.get_checks(test_name=test.name, apiutils=self.apiutils, name=test.name) + + # Generate Request for Test Data + when = self.robot.get_request(test_name=test.name, name=test.name) + + test_case = { + 'name': test.name, + 'permutation_tp_id': f'{self.base_TP_id}/{test.name.split(" ")[0]}', + 'doc': documentation, + 'tags': tags, + 'setup': test.setup.name, + 'teardown': test.teardown.name, + 'template': test.template, + 'then': then, + 'when': when + } + + try: + self.test_suite['initial_condition'] = self.initial_conditions[test.setup.name] + string = self.robot.get_substring(initial_string='** Keywords ***', final_string='', include=False) + except KeyError: + self.test_suite['initial_condition'] = self.initial_conditions['Initial State'] + string = self.robot.get_substring(initial_string='** Keywords ***', final_string='', include=False) + + self.test_cases.append(test_case) + + def get_body(self, string: str) -> str: + aux = string.split(' ')[1:] + + if len(aux) >= 2: + aux = [self.get_body(x) for x in aux] + aux = ' '.join(aux) + elif len(aux) == 1: + aux = sub(r'([a-z])([A-Z])', r'\1 \2', aux[0]) + else: + aux = sub(r'([a-z])([A-Z])', r'\1 \2', string) + + return aux + + def generate_name(self): + base_dir = dirname(dirname(dirname(__file__))) + tp_id = str(self.suite.source.parent).replace(f'{base_dir}/', "") + + for key, value in self.identifier.items(): + tp_id = tp_id.replace(key, value) + + self.base_TP_id = tp_id + + name = self.suite.name.replace(" ", "_") + tp_id = f'{self.base_TP_id}/{name}' + + return tp_id + + def generate_reference(self, version): + # Get the list of tags in the different tests + tags = [x.tags for x in self.suite.tests] + tags = [element for sublist in tags for element in sublist if element[0].isdigit()] + + if len(tags) == 0: + # We have different tests cases that call a test template, maybe the Tags are defined in the template + reference, pics = self.generate_reference_template(version=version) + else: + if len(self.robot.test_template_name) == 0: + # We have normal tests cases + reference, pics = self.generate_reference_testcases(tags=tags, version=version) + else: + # We have tests cases with information about tags but a template with information about documentation + reference, pics = self.generate_reference_testcases(tags=tags, version=version) + _, _ = self.generate_reference_template(version=version, need_tags=False) + + return reference, pics + + def generate_reference_template(self, version, need_tags=True): + # Get the list of arguments, we select the first one because the 2nd keyword corresponds + # to the teardown operation + args = [list(x.keywords)[0] for x in self.suite.tests] + args = [{str(x.parent): list(x.args)} for x in args] + self.args = dict() + _ = [self.args.update(x) for x in args] + + + template_name = list(set([list(x.keywords)[0].name for x in self.suite.tests]))[0] + + # Due to the information of the tags are contained in the Keyword description of the template, we need to + # analyse the Keyword. + string = self.robot.get_substring(initial_string='** Keywords ***', final_string='', include=False) + reference, pics = self.get_info_from_template(name=template_name, + string=string, + version=version, + need_tags=need_tags) + + return reference, pics + + def get_info_from_template(self, name: str, string: str, version: str, need_tags: bool): + # TODO: Check that the name of the template is in the string receive + # Get the Tags line and the tag value + reference = str() + pics = str() + + tags = self.get_substring(string=string, key='[Tags]') + self.tags_template = tags[1:] + + if need_tags: + try: + tag = list(set([element for sublist in tags for element in tags if element[0].isdigit()]))[0] + except IndexError: + raise Exception("ERROR, Probably [Tags] does not include reference to the section in the spec.") + + reference = f'{self.references[version]}{tag.replace("_", ".")}' + pics = f'PICS_{tag}' + + # Get the arguments + self.arguments = self.get_substring(string=string, key='[Arguments]') + self.arguments = self.arguments[1:] + + # Get the documentation + self.documentation_template = self.get_substring(string=string, key='[Documentation]') + self.documentation_template = self.documentation_template[1:][0] + + return reference, pics + + def get_substring(self, string: str, key: str): + pos1 = string.find(key) - 1 + pos2 = string[pos1:].find('\n') + result = string[pos1:pos1+pos2].split(' ') + + return result + + def generate_reference_testcases(self, tags: list, version: str): + # check_tags = all(item == tags[0] for item in tags) + # + # if check_tags is False or len(tags) == 0: + # raise Exception(f'ERROR: the Test Suite {{self.suite.name}} has different clauses or no clauses (Tags): {tags}\n' + # f'Unable to select the corresponding Reference of this Test Suite') + # else: + # # All the clauses are the same, so we select the first one + # reference = f'{{self.references[version]}}{tags[0].replace("_", ".")}' + # pics = f'PICS_{tags[0]}' + # + # return reference, pics + aux = [x for x in tags if match(pattern='^(\d+_\d+_\d+)', string=x)] + + if len(aux) == 0: + raise Exception( + f'ERROR: the Test Suite {self.suite.name} has different clauses or no clauses (Tags): {tags}\n' + f'Unable to select the corresponding Reference of this Test Suite') + else: + # All the clauses are the same, so we select the first one + reference = f'{self.references[version]}{aux[0].replace("_", ".")}' + pics = f'PICS_{aux[0]}' + + return reference, pics diff --git a/doc/analysis/initial_setup.py b/doc/analysis/initial_setup.py new file mode 100644 index 0000000000000000000000000000000000000000..0ac0275308a5464cb7fe6bcb165111f7a1cb6c85 --- /dev/null +++ b/doc/analysis/initial_setup.py @@ -0,0 +1,283 @@ +import os +import json + + +class InitialSetup: + def __init__(self): + self.init = { + 'Setup Initial Context Source Registration': InitialSetup.init_csr(), + 'Initialize the Test Case': InitialSetup.init_csr(), + 'Create New Context Source Registration': InitialSetup.init_csr(), + 'Create Initial Context Source Registration': InitialSetup.init_csr(), + 'Initiate Test Case': InitialSetup.init_entity(), + 'Create Initial Entity': InitialSetup.init_entity2(), + 'Setup Initial Entity': InitialSetup.init_entity2(), + 'Initialize Environment': InitialSetup.init_entity2(), + 'Initialize Test': InitialSetup.init_entity2(), + 'Create Temporal Entity': InitialSetup.init_temporal_entity(), + 'Create Initial Temporal Entity': InitialSetup.init_temporal_entity2(), + 'Initialize Test Case': InitialSetup.init_temporal_entity2(), + 'Initialize Setup': InitialSetup.init_temporal_entity2(), + 'Create Id': InitialSetup.init_temporal_entity2(), + 'Create Initial Subscription': InitialSetup.init_subscription(), + 'Setup Initial Subscriptions': InitialSetup.init_subscription(), + 'Setup Initial Entities': InitialSetup.init_entities(), + 'Setup Initial Temporal Entities': InitialSetup.init_temporal_entities(), + 'Create Initial Context Source Registration and Context Source Registration Subscription': + InitialSetup.init_csr_and_sub(), + 'Create Initial Context Source Registrations And Context Source Registration Subscription': + InitialSetup.init_csrs_and_sub(), + 'Setup Initial Context Source Registrations': InitialSetup.init_csrs(), + 'Setup Initial Context Source Registration Subscription': InitialSetup.init_csr_sub(), + 'Setup Initial Context Source Registration Subscriptions': InitialSetup.init_csr_subs(), + 'Create Initial Context Source Registration and Mock Server': InitialSetup.init_csr_and_server(), + } + + self.total_files = -1 + self.files_with_setup = -1 + self.files_without_setup = -1 + + self.code = list() + self.files_with_setup = list() + self.files_without_setup = list() + + self.check_keys() + + @staticmethod + def init_csr() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT contains a Context Source Registration + with id equal to ${context_source_registration_id} + and payload set to ${context_source_registration_payload_file_path} +}''' + + return data + + @staticmethod + def init_entity() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an initial Entity ${entity} + with an id set to ${entityId} + and an attribute with an id set to ${atrId} +}''' + return data + + @staticmethod + def init_entity2() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an initial Entity ${entity} + with an id set to ${entityId} +}''' + return data + + @staticmethod + def init_temporal_entity() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an initial Temporal Entity ${entity} + with an id set to ${temporal_entity_representation_id} + and an attribute with an id set to ${atrId} +}''' + return data + + @staticmethod + def init_temporal_entity2() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an initial Temporal Entity ${entity} + with an id set to ${temporal_entity_representation_id} +}''' + return data + + @staticmethod + def init_subscription() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an initial Subscription ${subscription} + with an id set to ${subscription_id} +}''' + return data + + @staticmethod + def init_entities() -> str: + data = '''with { + the SUT being in the "initial state" and + and containing a list of entities +}''' + return data + + @staticmethod + def init_temporal_entities() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing an a list of Temporal Entities +}''' + return data + + @staticmethod + def init_csr_and_sub() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing a Context Source Registration (CSR1) providing latest information about some entities + and the SUT containing a Context Source Registration Subscription (CSRS1) +}''' + return data + + @staticmethod + def init_csrs() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities +}''' + return data + + @staticmethod + def init_csrs_and_sub() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities + and the SUT containing a Context Source Registration Subscription (CSRS1) +}''' + return data + + @staticmethod + def init_csr_sub() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing a Context Source Registration Subscription (CSRS1) +}''' + return data + + @staticmethod + def init_csr_subs() -> str: + data = '''with { + the SUT being in the "initial state" and + the SUT containing a set of Context Source Registration Subscriptions (CSRSs) +}''' + return data + + @staticmethod + def init_csr_and_server() -> str: + data = '''with { + the SUT containing a Context Source Registration of a context source (CS1) + providing temporal information of two entities of type Building between 2020-08-01T22:07:00Z and 2021-08-01T21:07:00Z + and CS1 containing two temporal entities of type Building and temporal evolution of those entities in the mentioned interval. +}''' + return data + + @staticmethod + def init_csrs_subs() -> str: + data = '''with { + the SUT containing a Context Source Registration of a context source (CS1) + providing temporal information of two entities of type Building between 2020-08-01T22:07:00Z and 2021-08-01T21:07:00Z + and CS1 containing two temporal entities of type Building and temporal evolution of those entities in the mentioned interval. +}''' + return data + + def get_property_values(self, root_folder: str, property_name: str) -> [str, str]: + robot_files_without_setup = list() + robot_files_with_setup = list() + self.total_files = 0 + + for root, dirs, files in os.walk(root_folder): + for file in files: + if file.endswith(".json"): + file_path = os.path.join(root, file) + self.total_files = self.total_files + 1 + + with open(file_path, "r") as f: + try: + data = json.load(f) + value = [x[property_name] for x in data['test_cases']] + + status = all(item == value[0] for item in value) + + if not status: + print(f"{file_path} has different values of setup processes") + else: + value = value[0] + + info = { + 'file': file_path, + 'data': value + } + + if value is None: + robot_files_without_setup.append(file_path) + else: + robot_files_with_setup.append(info) + except (KeyError, json.JSONDecodeError): + # Handle cases where the property is not found or file is not valid JSON + pass + + return robot_files_with_setup, robot_files_without_setup + + def check_keys(self): + self.generate_dictionaries() + + keys = self.init.keys() + + deleted_setup = [item for item in keys if item not in self.code] + not_included_keys = [item for item in self.code if item not in keys] + + print('Checking the Setup functions...') + if len(deleted_setup) != 0: + print(f" WARNING: Some of the Setup functions were deleted:\n{deleted_setup}") + else: + print(" INFO: All current Setup functions are used in the Robot files") + + if len(not_included_keys) != 0: + print(f" ERROR: Some Setup functions are not include in the Class:\n{not_included_keys}") + else: + print(" INFO: All the current Setup functions used in Robot files are included in the Class") + + print() + + def generate_dictionaries(self): + folder = "/home/fla/Documents/workspace/bdd/ngsi-ld-test-suite/doc/files" + attribute = "setup" + + self.files_with_setup, self.files_without_setup = self.get_property_values(folder, attribute) + + aux = [x['data'] for x in self.files_with_setup] + self.code = list(set(aux)) + + self.files_with_setup = len(self.code) + self.files_without_setup = len(self.files_without_setup) + + def print_numbers(self): + print("Show details of the Setup functions:") + print(f" Total number of Robot files: {self.total_files}\n" + f" Total number of Robot Files with Setup information: {self.files_with_setup}\n" + f" Total number of Robot Files without Setup information: {self.files_without_setup}") + + print() + + def get_setups(self) -> list: + return self.code + + def get_robot_files_without_setup(self) -> list: + return self.files_without_setup + + def get_initial_condition(self, initial_condition: str) -> str: + try: + return self.init[initial_condition] + except KeyError: + print(f"ERROR: the initial condition '{initial_condition}' is not defined in the dictionary. " + f"Please check it and add the new initial condition.") + data = '''with { + the SUT containing an initial state +}''' + return data + + +if __name__ == "__main__": + instance = InitialSetup() + + instance.print_numbers() + + print(instance.get_initial_condition(initial_condition="Setup Initial Context Source Registration")) + print(instance.get_initial_condition(initial_condition="Lorem Ipsum dolor sit")) diff --git a/doc/analysis/parseapiutilsfile.py b/doc/analysis/parseapiutilsfile.py new file mode 100644 index 0000000000000000000000000000000000000000..3c55f93ac32c91e2ca11eb5f81bf75c1bc8e9aff --- /dev/null +++ b/doc/analysis/parseapiutilsfile.py @@ -0,0 +1,142 @@ +import re + + +class ParseApiUtilsFile: + def __init__(self, filename: str): + with open(filename, 'r') as file: + # Read the contents of the file + self.file_contents = file.read() + + self.variables = dict() + + self.get_variables_data() + + def get_response(self, keyword): + verb = str() + url = list() + query_param = False + + string = self.get_substring(initial_string=keyword, final_string='RETURN', include=True) + index = string.find(' ${response}') + string = string[index:] + string = string.split('\n') + + index = None + for i, item in enumerate(string): + if 'response' in item: + regex = "\s{4}\$\{response\}=\s{4}(POST|GET|PUT|PATCH|DELETE).*" + match = re.match(pattern=regex, string=item) + + if match: + verb = match.groups()[0] + elif 'url' in item: + url, query_param = self.get_url_request(url=item) + + return verb, url, query_param + + @staticmethod + def get_url_request(url: str) -> list: + # We have two options, the url is defined in the same line of the response or it is defined in the following + # lines with '...' + keys = list() + parameters = list() + query_param = False + + if 'response' in url: + url = [x for x in url.split(' ') if 'url' in x][0] + + regex = r"\s*\.*\s*url=\$\{url\}\/(.*)" + + match = re.match(pattern=regex, string=url) + if match: + aux = match.groups()[0] + + # We need to extract the url parameters first + if aux.find('?') != -1: + parameters = aux.split('?') + aux = parameters[0] + query_param = True + + keys = re.split(r'\$|/', aux) + keys = [k for k in keys if k != ''] + + if len(parameters) != 0: + keys.append("".join(parameters[1:])) + else: + regex = r"\s*\.*\s*url=\$\{temporal_api_url\}\/(.*)" + + match = re.match(pattern=regex, string=url) + if match: + aux = match.groups()[0] + keys = re.split(r'\$|/', aux) + keys = [k for k in keys if k != ''] + + return keys, query_param + + def get_variables_data(self): + string = self.get_substring(initial_string='*** Variables ***', final_string='*** ', include=False) + + self.get_variables_data_variables(string=string) + self.get_variables_data_dictionaries(string=string) + + def get_variables_data_variables(self, string): + # Get the simple variables from the file + regex = "^(\$\{.*\})\s*(.*)\n" + + matches = re.finditer(regex, string, re.MULTILINE) + for match in matches: + # Check that we have two groups matched + if len(match.groups()) == 2: + if match.group(1) not in self.variables.keys(): + self.variables[match.group(1)] = match.group(2) + else: + raise Exception("Error, the variable is not following the format ${thing} = ") + + def get_variables_data_dictionaries(self, string): + # Get the dictionary variables from the file + regex = '(\&\{.*\})' + matches = re.finditer(regex, string, re.MULTILINE) + for match in matches: + # Check that we have two groups matched + if len(match.groups()) == 1: + # We need to find in the string the index to know the next lines from which extract the data + key_dict = match.group(1).replace("&", "$") + + index = string.find(match.group(1)) + aux = string[index:] + index = aux.find('\n') + aux = aux[index:] + index = aux.find('\n${') + aux = aux[:index + 1] + + regex = '\.{3}[ ]*([a-zA-Z]+)=(.*)\n' + matches2 = re.finditer(regex, aux, re.MULTILINE) + dict_values = dict() + for match2 in matches2: + # Check that we have two groups matched + if len(match2.groups()) == 2: + key = match2.group(1) + value = match2.group(2) + + value_is_variable = re.match(pattern=r'\$\{.*\}', string=value) + if value_is_variable: + value = self.variables[value] + + dict_values[key] = value + + self.variables[key_dict] = dict_values + else: + raise Exception("Error, the variable is not following the format ${thing} = ") + + def get_substring(self, initial_string: str, final_string: str, include: bool) -> str: + index_start = self.file_contents.find(initial_string + '\n') + + if include: + string = self.file_contents[index_start:] + else: + string = self.file_contents[index_start+len(initial_string):] + + index_end = string.find(final_string) + string = string[:index_end] + + return string diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py new file mode 100644 index 0000000000000000000000000000000000000000..6fe294d6d55defdd9866ec8829c2a155c6449bc2 --- /dev/null +++ b/doc/analysis/parserobotfile.py @@ -0,0 +1,524 @@ +import re +import os +from analysis.checks import Checks +from analysis.requests import Requests + + +class ParseRobotFile: + def __init__(self, filename: str, execdir: str, config_file): + self.test_suite = os.path.basename(filename).split('.')[0] + + with open(filename, 'r') as file: + # Read the contents of the file + self.file_contents = file.read() + + self.variables = dict() + self.execdir = execdir + self.resource_files = list() + self.apiutils = list() + + self.string_test_template = str() + self.test_template_name = str() + self.template_params_value = dict() + self.check_template() + + self.get_variables_data() + self.get_apiutils_path() + self.get_test_cases() + + self.config_file = config_file + + def check_template(self): + # Check if there is a template and which template we have + aux = re.findall(pattern=r'Test Template[ ]+(.*)', string=self.file_contents) + + if len(aux) != 0: + self.test_template_name = aux[0] + else: + self.test_template_name = '' + + def set_apiutils(self, apiutils): + self.apiutils = apiutils + + def get_variables_data(self): + string = self.get_substring(initial_string='*** Variables ***\n', final_string='*** ', include=False) + + regex = r"(\$\{.*\})\s*=\s*(.*)\n" + + matches = re.finditer(regex, string, re.MULTILINE) + for match in matches: + # Check that we have two groups matched + if len(match.groups()) == 2: + self.variables[match.group(1)] = match.group(2) + else: + raise Exception("Error, the variable is not following the format ${thing} = ") + + def get_apiutils_path(self): + string = self.get_substring(initial_string='Resource', final_string='*** Variables ***', include=True) + result = [item for item in string.split('\n') if 'ApiUtils' in item and item[0] != '#'] + self.resource_files = [x.replace('${EXECDIR}', self.execdir) for x in result] + + regex = r"\s*Resource\s*(.*)\s*" + result = [re.match(pattern=regex, string=x).group(1) for x in result] + self.resource_files = [x.replace('${EXECDIR}', self.execdir) for x in result] + + # if len(result) >= 1: + # regex = r"\s*Resource\s*(.*)\s*" + # + # matches = re.finditer(regex, result[0], re.MULTILINE) + # for match in matches: + # # Check that we have 1 group matched + # if len(match.groups()) == 1: + # self.resource_file.append(match.group(1)) + # else: + # raise Exception("Error, unexpected format") + # + # self.resource_file = self.resource_file.replace('${EXECDIR}', self.execdir) + + def get_substring(self, initial_string: str, final_string: str, include: bool) -> str: + index_start = self.file_contents.find(initial_string) + + if include: + string = self.file_contents[index_start:] + else: + string = self.file_contents[index_start+len(initial_string):] + + if final_string != '': + index_end = string.find(final_string) + string = string[:index_end] + + return string + + def get_test_cases(self): + if self.test_template_name == '': + self.get_test_cases_without_template() + else: + self.get_test_cases_with_template() + + def get_test_cases_with_template(self): + # In case of template, we have to get the value of the tags and the parameters value from the Test Cases and + # the content of the operations from the corresponding Keyword content corresponding to the Test Template + index_start_test_cases = self.file_contents.find('*** Test Cases ***') + index_start_keywords = self.file_contents.find('*** Keywords ***') + + string_test_cases = self.file_contents[index_start_test_cases+len('*** Test Cases ***')+1:index_start_keywords] + self.string_test_template = self.file_contents[index_start_keywords+len('*** Keywords ***')+1:] + self.get_template_content(string=self.string_test_template) + + self.get_test_cases_content(string=string_test_cases) + self.get_template_param_values(test_cases=string_test_cases) + + def get_template_content(self, string: str): + matches = re.findall(pattern=r'^(([a-zA-z0-9\-\/]+[ ]*)+)$', string=string, flags=re.MULTILINE) + + indexes = list() + for match in matches: + indexes.append(string.rfind(match[0])) + + subdata = list() + for i in range(0, len(indexes) - 1): + subdata.append(string[indexes[i]:indexes[i + 1]]) + + index = indexes[len(indexes) - 1] + subdata.append(string[index:]) + + self.string_test_template = [x for x in subdata if self.test_template_name in x][0] + + def get_template_param_values(self, test_cases): + # Extract the parameter of the Test Cases + # the first line is the argument of the test case + params = test_cases.split("\n")[0].strip().split(" ") + params = [x.lower() for x in params] + + # Obtain the params values + keys = self.test_cases.keys() + data = self.test_cases + + for k in keys: + aux = data[k] + aux = aux.split('\n')[1:] + aux = [x.strip() for x in aux if x.find("[Tags]") == -1][0] + aux = aux.split(" ") + + result = [{f"${{{k}}}": v} for k, v in zip(params, aux)] + result = {k: v for d in result for k, v in d.items()} + + self.template_params_value[k] = result + + def get_test_cases_content(self, string): + pattern = f'{self.test_suite}_\d+[ ]+.*' + matches = re.findall(pattern=pattern, string=string) + + indexes = list() + self.test_case_names = list() + if matches: + for match in matches: + name = match.strip() + self.test_case_names.append(name) + indexes.append(string.find(name)) + else: + # The test case has the same id. number as the test suite + pattern = f'{self.test_suite}\s.*' + matches = re.findall(pattern=pattern, string=string) + + for match in matches: + name = match.strip() + self.test_case_names.append(name) + indexes.append(string.find(name)) + + self.test_cases = dict() + for i in range(0, len(indexes)-1): + self.test_cases[self.test_case_names[i]] = string[indexes[i]:indexes[i+1]] + + try: + self.test_cases[self.test_case_names[-1]] = string[indexes[-1]:] + except IndexError: + raise Exception(f"ERROR, List index out of range, " + f"probably the name of the Test Case is not following the pattern '{pattern}'") + + def get_test_cases_without_template(self): + index_start_test_cases = self.file_contents.find('*** Test Cases ***') + index_start_keywords = self.file_contents.find('*** Keywords ***') + + string_test_cases = self.file_contents[index_start_test_cases+len('*** Test Cases ***')+1:index_start_keywords] + + self.get_test_cases_content(string=string_test_cases) + + def get_text_cases_content(self, name: str): + if self.test_template_name == '': + result = self.test_cases[name] + else: + result = self.string_test_template + + return result + + def get_checks(self, test_name, apiutils, name): + data = Checks() + self.test_name = test_name + self.test_case_name = name + + # test_content = self.test_cases[test_name] + test_content = self.get_text_cases_content(name=test_name) + + # Get The lines starting by 'Check' + checks = list() + param = dict() + lines_starting_with_check = self.get_lines_with_checks(content=test_content) + for line in lines_starting_with_check: + check, param, attributes = self.get_data_check(test_case=test_content, checks=data, line=line) + operation = self.get_operation_of_the_check(test_content=test_content, param=attributes) + result = data.get_checks(checks=check, **param) + + content = { + 'operation': operation, + 'checks': result + } + + checks.append(content) + + result = self.generate_then_content(content=checks) + + return result + + def get_operation_of_the_check(self, test_content: str, param: dict) -> str: + if param == 'Notification': + operation = param + else: + values = [x for x in param if x.find('${') != -1] + values = [f"{x.split('.')[0]}}}" if x.find(".") != -1 else x for x in values] + + values = [x for x in values if x.find('response') != -1] + + if len(values) != 0: + # We need to find the operation of the response + index = [test_content.find(x) for x in values] + index = [x for x in index if x != -1][0] + + substring = test_content[index:] + end_line = substring.find('\n') + substring = substring[0:end_line] + + operation = substring.split(' ')[1] + else: + # We have a notification operation + operation = 'Notification' + + return operation + + def get_lines_with_checks(self, content): + new_list = list() + + # Obtain the complete list of lines that contains a Check + lines_starting_with_check = re.findall(r'^\s*Check.*', content, re.MULTILINE) + + if len(lines_starting_with_check) != 0: + # TODO: From the list of Checks, we need to discard all 'Check Response Status Code' except the last one. Should be resolve when clearly defined the Setup process of the Test Suite + # check_string = 'Check Response Status Code' + # lines_starting_with_check = [x.strip() for x in lines_starting_with_check] + # new_list = [value for value in lines_starting_with_check if not value.startswith(check_string)] + # abb_values = [value for value in lines_starting_with_check if value.startswith(check_string)] + + # if abb_values: + # new_list.append(abb_values[-1]) + new_list = [x.strip() for x in lines_starting_with_check] + elif content.find('Wait for notification') != 0: + # There is no Check, we need to check if there is a 'Wait for notification', + # then we need to check the 'Should be Equal' sentences + pattern = r'(Wait for no notification)|(Wait for notification and validate it)|(Wait for notification)([ ]{4}(.*))?' + param = re.findall(pattern=pattern, string=content, flags=re.MULTILINE) + for i in range(0, len(param)): + data = tuple(element for element in param[i] if element != '') + + match data[0]: + case 'Wait for notification and validate it': + new_list.append(f'Wait for notification and validate it') + case 'Wait for no notification': + new_list.append(f'Wait for no notification') + case 'Wait for notification': + last_index = len(data) - 1 + timeout = data[last_index] + + if timeout != '': + new_list.append(f'Wait for notification {timeout}') + else: + new_list.append(f'Wait for notification 5') + case _: + raise Exception(f"Unexpected Wait for notification check: '{param[i][0]}'") + + lines_starting_with_should = re.findall(r'^\s*Should be Equal.*', content, re.MULTILINE) + _ = [new_list.append(x.strip()) for x in lines_starting_with_should] + + lines_starting_with_should = re.findall(r'^\s*Dictionary Should Contain Key.*', content, re.MULTILINE) + _ = [new_list.append(x.strip()) for x in lines_starting_with_should] + + lines_starting_with_should = re.findall(r'^\s*Should Not Be Empty.*', content, re.MULTILINE) + _ = [new_list.append(x.strip()) for x in lines_starting_with_should] + + lines_starting_with_should = re.findall(r'^\s*Should be True.*', content, re.MULTILINE) + _ = [new_list.append(x.strip()) for x in lines_starting_with_should] + + return new_list + + def get_request(self, test_name, name): + flattened_list_variables = {k: v for d in self.apiutils for k, v in d.variables.items()} + data = Requests(variables=self.variables, + apiutils_variables=flattened_list_variables, + config_file=self.config_file, + template_params_value=self.template_params_value, + test_name=test_name, + name=name) + + if self.test_template_name == '': + description = data.get_description(string=self.test_cases[test_name]) + else: + description = data.get_description(string=self.string_test_template) + + return description + + def generate_then_content(self, content): + # Need to check if it is a Notification data or a normal Response + aux = [x for x in content if x['checks'].find('Notification data') != -1 or x['checks'].find('After waiting') != -1 or x['checks'].find('Notification and validate') != -1] + + if len(aux) == 0: + # The SUT sends a valid Response + checks = [f"{x['operation']} with {x['checks']}" for x in content] + checks = [x.replace(" ", " ") for x in checks] + if len(content) > 1: + checks = " and\n ".join(checks) + checks = f"then {{\n the SUT sends a valid Response for the operations:\n {checks}\n}}" + elif len(content) == 1: + checks = f"then {{\n the SUT sends a valid Response for the operation:\n {checks[0]}\n}}" + else: + raise Exception("ERROR, It is expected at least 1 Check operation in the Test Case") + else: + # The Client receives a valid Notification + checks = [f"{x['operation']} received {x['checks']}" for x in content] + if len(checks) > 1: + checks = " and\n ".join(checks) + checks = (f"then {{\n the client at '${{endpoint}}' receives a valid Notification containing:\n" + f" {checks}\n}}") + elif len(content) == 1: + checks = checks[0] + checks = (f"then {{\n the client at '${{endpoint}}' receives a valid Notification containing:\n" + f" {checks}\n}}") + # if content[0]['checks'].find('Waiting for no Notification') != -1: + # # Waiting for no notification data + # print("Error, need to control the generation of then message") + # exit(-1) + # match = re.match(pattern=r"[\W\w]+'(\d+)'", string=content[0]) + # try: + # checks = f"then {{\n the SUT will not send a CsourceNotification after {match.group(1)} seconds}}" + # except Exception: + # raise Exception(f"ERROR: unexpected timeout parameter: '{content[0]}'") + # else: + # print("Error, need to control the generation of then message") + # exit(-1) + # checks = (f"then {{\n the client at '${{endpoint}}' receives a valid Notification, {content[0]}\n}}") + else: + raise Exception("ERROR, It is expected at least 1 Notification Check operation in the Test Case") + + return checks + + def generate_when_content(self, http_verb, endpoint, when): + if when.find("a subscription with id set to") == -1: + url = f"URL set to '/ngsi-ld/v1/{endpoint}'" + method = f"method set to '{http_verb}'" + when = (f"when {{\n the SUT receives a Request from the client containing:\n" + f" {url}\n" + f" {method}\n" + f" {when}\n" + f"}}") + else: + # This is a Notification operation + when = f"The client at ${{endpoint}} receives a valid Notification containing {when}" + return when + + def get_data_check(self, test_case, checks, line): + content = line.split(" ") + + # Discard lines that are comments + # content = [x for x in content if x.strip()[0] != '#'] + aux = len(content) + + try: + position_params = checks.args[content[0]] + if aux == 1: + # We are in multiline classification of the Check, need to extract the parameter for the next lines + params, attributes = self.find_attributes_next_line(test_case=test_case, name=content[0], + position_params=position_params) + return content[0], params, attributes + elif aux > 1: + # We are in one line definition + params = self.find_attributes_same_line(params=position_params, content=content[1:]) + + if content[0] == 'Wait for notification' or content[0] == 'Should be Equal': + attributes = 'Notification' + else: + attributes = content[1:] + + return content[0], params, attributes + else: + raise Exception("ERROR, line should contain data") + except KeyError: + # The Check operation does not require parameters + return content[0], dict(), list() + + def find_attributes_same_line(self, params, content): + result = dict() + + if len(params['position']) > 0: + for i in range(0, len(params['position'])): + param_key = params['params'][i] + param_position = params['position'][i] + param_value = self.get_param_value(position=content[param_position]) + result[param_key] = param_value + elif len(params['position']) == 0: + for i in range(0, len(params['params'])): + param_key = params['params'][i] + param_value = self.get_param_value_for_waiting(param_key=param_key, content=content) + + if param_value is not None: + result[param_key] = param_value + + return result + + def get_param_value_for_waiting(self, param_key, content): + found = [x for x in content if x.find(param_key) != -1] + length = len(found) + + if length != 0: + found = found[0] + + if found.find('=') != -1: + # in the format variable=${value} + # pattern = f"{param_key}=\${{(\d+)}}" + pattern = f"{param_key}=\${{([\w\W]+)}}|{param_key}=([\w\W]+)" + else: + pattern = f"\${{([\w\W]+)}}|([\w\W]+)" + + # elif length == 0 and len(content) > 1: + # # There is params but they are not written in the form key=value + # found = content[1] + # # pattern = f"\${{(\d+)}}" + # pattern = f"\${{([\w\W]+)}}|([\w\W]+)" + else: + pattern = '' + found = '' + return + + value = re.match(pattern=pattern, string=found) + + try: + aux = value.group(2) + if aux is None: + aux = value.group(1) + value = aux + except AttributeError: + value = '' + + return value + + def find_attributes_next_line(self, test_case, name, position_params): + index_start = test_case.find(name) + + aux = test_case[index_start+len(name)+1:].split('\n') + + params = list() + attributes = list() + for a in range(0, len(aux)): + param = aux[a] + # if param.startswith(" ..."): + # data = param.split(' ')[-1] + # params.append(data) + # if data.find('=') != -1: + # data = data.split('=')[-1] + # + # attributes.append(data) + # else: + # break + + regex = '(\s{4})*\s{4}\.{3}\s{4}(.*)' + data = re.match(pattern=regex, string=param) + if data: + data = data.groups()[-1] + params.append(data) + + if data.find('=') != -1: + data = data.split('=')[-1] + + attributes.append(data) + else: + break + + param = self.find_attributes_same_line(params=position_params, content=params) + return param, attributes + + def get_param_value(self, position): + try: + # Check if we can get the data from the current robot files + result = self.variables[position] + except KeyError: + try: + # Check if we can get the data from the apiutils file + # TODO: this operation is calculated every time that wanted to calculate this operation + flattened_list = {k: v for d in self.apiutils for k, v in d.variables.items()} + result = flattened_list[position] + except KeyError: + try: + aux = re.findall(pattern=r'\$\{(.*)}', string=position) + if len(aux) != 0: + aux = aux[0] + else: + aux = position + result = self.config_file.get_variable(aux) + except KeyError: + try: + aux = self.template_params_value[self.test_case_name] + result = aux[position] + + if result[:2] == "${": + result = self.get_param_value(result) + except KeyError: + result = position + + return result diff --git a/doc/analysis/parsevariablesfile.py b/doc/analysis/parsevariablesfile.py new file mode 100644 index 0000000000000000000000000000000000000000..f56bd51cc74f59caa76e5f7b707e826a5313e8f6 --- /dev/null +++ b/doc/analysis/parsevariablesfile.py @@ -0,0 +1,24 @@ +from os.path import dirname + + +class ParseVariablesFile: + def __init__(self): + folder = dirname(dirname(dirname(__file__))) + filename = f'{folder}/resources/variables.py' + self.variables = dict() + + with open(filename, 'r') as file: + # Read the contents of the file + file_content = file.read() + + file_content = file_content.split('\n') + file_content = [x.split('=') for x in file_content if x != ''] + + self.variables = {x[0].strip(): x[1].replace("'", "").strip() for x in file_content} + + def get_variable(self, variable: str) -> str: + # We request the variable in the form '${...}' + variable = variable.strip('${}') + value = self.variables[variable] + + return value diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py new file mode 100644 index 0000000000000000000000000000000000000000..5a408d095b241302731548ca34fce52fb03fbb87 --- /dev/null +++ b/doc/analysis/requests.py @@ -0,0 +1,1544 @@ +import re + + +class Requests: + def __init__(self, variables, apiutils_variables, config_file, template_params_value, test_name, name): + self.op = { + 'Create Entity Selecting Content Type': { + 'positions': [0, 2], + 'params': ['filename', 'content_type'] + }, + 'Create Subscription': { + 'positions': [1, 2], + 'params': ['filename', 'content_type'] + }, + 'Create Or Update Temporal Representation Of Entity Selecting Content Type': { + 'positions': [], + 'params': ['temporal_entity_representation_id', 'filename', 'content_type', 'accept'] + }, + 'Create Entity From File': { + 'positions': [0], + 'params': ['filename'] + }, + 'Batch Create Entities': { + 'positions': [1], + 'params': ['content_type'] + }, + 'Create Context Source Registration With Return': { + 'positions': [0], + 'params': ['filename'] + }, + 'Query Entity': { + 'positions': [], + 'params': ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options'] + }, + 'Retrieve Subscription': { + 'positions': [], + 'params': ['id', 'accept', 'context', 'content_type'] + }, + 'Query Context Source Registrations With Return': { + 'positions': [0, 1], + 'params': ["type", "accept"] + }, + 'Query Temporal Representation Of Entities With Return': { + 'positions': [], + 'params': [] + }, + 'Partial Update Entity Attributes': { + 'positions': [], + 'params': ['entityId', 'attributeId', 'fragment_filename', 'content_type', 'accept', 'context'] + }, + 'Update Subscription': { + 'positions': [1, 2, 3], + 'params': ['filename', 'content', 'context'] + + }, + 'Query Context Source Registration Subscriptions': { + 'positions': [], + 'params': ['context', 'limit', 'page', 'accept'] + }, + 'Query Temporal Representation Of Entities': { + 'positions': [], + 'params': ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', + 'ngsild_query', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timerel', 'timeAt', + 'attrs', 'limit', 'lastN', 'accept'] + }, + 'Query Temporal Representation Of Entities Via Post': { + 'positions': [], + 'params': ['query_file_name', 'content_type', 'context'] + }, + 'Retrieve Attribute': { + 'positions': [0], + 'params': ['attribute_name'] + }, + 'Retrieve Entity Type': { + 'positions': [0, 1], + 'params': ['type', 'context'] + }, + 'Retrieve Entity by Id': { + 'positions': [], + 'params': ['id', 'accept', 'context'] + }, + 'Query Entities': { + 'positions': [], + 'params': ['entity_ids', 'entity_types', 'accept', + 'attrs', 'context', 'geoproperty', + 'options', 'limit', 'entity_id_pattern', + 'georel', 'coordinates', 'geometry'] + }, + 'Query Entities Via POST': { + 'positions': [], + 'params': ['entity_ids', 'entity_type', 'content_type', 'accept', + 'context', 'attrs', 'entity_id_pattern', 'geometry_property'] + }, + 'Retrieve Temporal Representation Of Entity': { + 'positions': [], + 'params': ['temporal_entity_representation_id', 'attrs', 'options', + 'context', 'timerel', 'timeAt', + 'endTimeAt', 'lastN', 'accept'] + }, + 'Delete Entity by Id': { + 'positions': [0], + 'params': ['id'] + }, + 'Append Entity Attributes': { + 'positions': [0, 1, 2], + 'params': ['id', 'fragment_filename', 'content_type'] + }, + 'Update Entity Attributes': { + 'positions': [0, 1, 2], + 'params': ['id', 'fragment_filename', 'content_type'] + }, + 'Delete Temporal Representation Of Entity With Returning Response': { + 'positions': [0], + 'params': ['id'] + }, + 'Append Attribute To Temporal Entity': { + 'positions': [0, 1, 2], + 'params': ['id', 'fragment_filename', 'content_type'] + }, + 'Delete Subscription': { + 'positions': [0], + 'params': ['id'] + }, + 'Query Subscriptions': { + 'positions': [], + 'params': ['context', 'limit', 'offset', 'accept'] + }, + 'Retrieve Context Source Registration Subscription': { + 'positions': [], + 'params': ['subscription_id', 'context', 'accept'] + }, + 'Retrieve Context Source Registration': { + 'positions': [], + 'params': ['context_source_registration_id', 'context', 'accept'] + }, + 'Delete Context Source Registration With Return': { + 'positions': [0], + 'params': ['id'] + }, + 'Query Context Source Registrations': { + 'positions': [], + 'params': ['context', 'id', 'type', 'attrs', + 'q', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timeproperty', 'timerel', + 'timeAt', 'limit', 'page', 'accept'] + }, + 'Update Context Source Registration With Return': { + 'positions': [0, 1, 2], + 'params': ['id', 'filename', 'content'] + }, + 'Retrieve context source registration subscription': { + 'positions': [0], + 'params': ['id'] + }, + 'Create Context Source Registration Subscription': { + 'positions': [0], + 'params': ['filename'] + }, + 'Create Context Source Registration': { + 'positions': [0], + 'params': ['context_source_registration_payload'] + }, + 'Delete Context Source Registration Subscription': { + 'positions': [0], + 'params': ['id'] + }, + 'Update Context Source Registration Subscription': { + 'positions': [0, 1], + 'params': ['subscription_id', 'subscription_update_fragment'] + }, + 'Update Context Source Registration': { + 'positions': [0, 1], + 'params': ['context_source_registration_id', 'update_fragment'] + }, + 'Update Context Source Registration Subscription From File': { + 'positions': [0, 1], + 'params': ['subscription_id', 'subscription_update_fragment'] + }, + 'Retrieve Attributes': { + 'positions': [], + 'params': ['context', 'details', 'accept'] + }, + 'Retrieve Entity Types': { + 'positions': [], + 'params': ['context', 'details', 'accept'] + }, + 'Batch Request Entities From File': { + 'positions': [0, 1], + 'params': ['operation', 'filename'] + }, + 'Batch Delete Entities': { + 'positions': [], + 'params': ['entities_ids_to_be_deleted', 'teardown'] + }, + 'Batch Update Entities': { + 'positions': [0], + 'params': ['entities', 'overwrite_option'] + }, + 'Batch Upsert Entities': { + 'positions': [], + 'params': ['entities_to_be_upserted', 'update_option'] + }, + 'Request Entity From File': { + 'positions': [0], + 'params': ['filename'] + }, + 'Delete Entity Attributes': { + 'positions': [], + 'params': ['entityId', 'attributeId', 'datasetId', 'deleteAll', 'context'] + }, + 'Create Temporal Representation Of Entity Selecting Content Type': { + 'positions': [0, 1], + 'params': ['filename', 'content_type'] + }, + 'Delete Attribute From Temporal Entity': { + 'positions': [], + 'params': ['entityId', 'attributeId', 'content_type', 'datasetId', 'deleteAll', 'context'] + }, + 'Delete Attribute Instance From Temporal Entity': { + 'positions': [0, 1, 2, 3, 4], + 'params': ['temporal_entity_id', 'attributeId', 'instanceId', 'content_type', 'context'] + }, + 'Modify Attribute Instance From Temporal Entity': { + 'positions': [0, 1, 2, 3, 4], + 'params': ['temporal_entity_id', 'attributeId', 'instanceId', 'fragment_filename', 'content_type', 'context'] + }, + 'Create Subscription From File': { + 'positions': [0], + 'params': ['filename'] + }, + 'Wait for notification': { + 'positions': [0], + 'params': ['timeout'] + }, + 'Append Entity Attributes With Parameters': { + 'positions': [0, 1, 2, 3], + 'params': ['id', 'fragment_filename', 'content_type', 'options'] + }, + 'Setup Initial Subscriptions': { + 'positions': [], + 'params': [] + } + } + + self.description = { + 'Create Entity Selecting Content Type': + Requests.create_entity_selecting_content_type, + 'Create Subscription': + Requests.create_entity_selecting_content_type, + 'Create Entity From File': + Requests.create_entity_from_file, + 'Create Or Update Temporal Representation Of Entity Selecting Content Type': + Requests.create_or_update_temporal_representation_of_entity_selecting_content_type, + 'Batch Create Entities': + Requests.batch_create_entities, + 'Create Context Source Registration With Return': + Requests.create_context_source_registration_with_return, + 'Query Entity': + Requests.query_entity, + 'Retrieve Subscription': + Requests.retrieve_subscription, + 'Query Context Source Registrations With Return': + Requests.query_context_source_registrations_with_return, + 'Query Temporal Representation Of Entities With Return': + Requests.query_temporal_representation_of_entities_with_return, + 'Partial Update Entity Attributes': + Requests.partial_update_entity_attributes, + 'Update Subscription': + Requests.update_subscription, + 'Query Context Source Registration Subscriptions': + Requests.query_context_source_registration_subscriptions, + 'Query Temporal Representation Of Entities': + Requests.query_temporal_representation_of_entities, + 'Append Entity Attributes With Parameters': + Requests.append_entity_attributes_with_parameters, + 'Retrieve Attribute': + Requests.retrieve_attribute, + 'Retrieve Entity Type': + Requests.retrieve_entity_type, + 'Retrieve Entity by Id': + Requests.retrieve_entity_by_id, + 'Query Entities': + Requests.query_entities, + 'Delete Entity by Id': + Requests.delete_entity_by_id, + 'Append Entity Attributes': + Requests.append_entity_attributes, + 'Update Entity Attributes': + Requests.update_entity_attributes, + 'Retrieve Temporal Representation Of Entity': + Requests.retrieve_temporal_representation_of_entity, + 'Delete Temporal Representation Of Entity With Returning Response': + Requests.delete_temporal_representation_of_entity_with_returning_response, + 'Append Attribute To Temporal Entity': + Requests.append_attribute_to_temporal_entity, + 'Delete Subscription': + Requests.delete_subscription, + 'Query Subscriptions': + Requests.query_subscriptions, + 'Retrieve Context Source Registration Subscription': + Requests.retrieve_context_source_registration_subscription, + 'Retrieve Context Source Registration': + Requests.retrieve_context_source_registration, + 'Delete Context Source Registration With Return': + Requests.delete_context_source_registration_with_return, + 'Query Context Source Registrations': + Requests.query_context_source_registrations, + 'Update Context Source Registration With Return': + Requests.update_context_source_registration_with_return, + 'Update Context Source Registration': + Requests.update_context_source_registration, + 'Retrieve context source registration subscription': + Requests.retrieve_context_source_registration_subscription_2, + 'Create Context Source Registration Subscription': + Requests.create_context_source_registration_subscription, + 'Delete Context Source Registration Subscription': + Requests.delete_context_source_registration_subscription, + 'Update Context Source Registration Subscription': + Requests.update_context_source_registration_subscription, + 'Update Context Source Registration Subscription From File': + Requests.update_context_source_registration_subscription_from_file, + 'Retrieve Attributes': + Requests.retrieve_attributes, + 'Retrieve Entity Types': + Requests.retrieve_entity_types, + 'Batch Request Entities From File': + Requests.batch_request_entities_from_file, + 'Batch Delete Entities': + Requests.batch_delete_entities, + 'Batch Update Entities': + Requests.batch_update_entities, + 'Batch Upsert Entities': + Requests.batch_upsert_entities, + 'Request Entity From File': + Requests.request_entity_from_file, + 'Delete Entity Attributes': + Requests.delete_entity_attributes, + 'Create Temporal Representation Of Entity Selecting Content Type': + Requests.create_temporal_representation_of_entity_selecting_content_type, + 'Delete Attribute From Temporal Entity': + Requests.delete_attribute_from_temporal_entity, + 'Delete Attribute Instance From Temporal Entity': + Requests.delete_attribute_instance_from_temporal_entity, + 'Modify Attribute Instance From Temporal Entity': + Requests.modify_attribute_instance_from_temporal_entity, + 'Create Subscription From File': + Requests.create_subscription_from_file, + 'Wait for notification': + Requests.wait_for_notification, + 'Create Context Source Registration': + Requests.create_context_source_registration, + 'Query Entities Via POST': + Requests.query_entities_via_post, + 'Query Temporal Representation Of Entities Via Post': + Requests.query_temporal_representation_of_entities_via_post, + 'Setup Initial Subscriptions': + Requests.setup_initial_subscriptions + } + + self.variables = variables + self.apiutils_variables = apiutils_variables + self.config_file = config_file + self.template_params_value = template_params_value + self.test_name = test_name + self.name = name + + def get_description(self, string): + keys = self.op.keys() + params = dict() + + # New version + #lines_starting_response = re.findall(r'^\s*\$\{response\}.*|^\s*\$\{notification\}.*', string, re.MULTILINE) + lines_starting_response = re.findall(r'^\s*\$\{response\}.*', string, re.MULTILINE) + + # If there is more than one line, it means that the test case has several operations, all of them to + # create the environment content to execute the last one, which is the correct one to test the Test Case + if len(lines_starting_response) > 1: + # The last one corresponds to the execution of the test, the rest corresponds to the initial condition of + # test case... + response_to_check = lines_starting_response[-1] + else: + response_to_check = lines_starting_response[0] + + index = string.find(response_to_check) + aux = string[index:].split('\n') + aux = [x for x in aux if x != ''] + + params = list() + request = str() + + # Get the list of params of the function, they are the keys + if len(aux) == 1 or (len(aux) > 1 and ' ... ' not in aux[1]): + # the attributes are in the same line + regex = r"\s*\$\{response\}=\s{4}(.*)" + matches = re.finditer(regex, response_to_check, re.MULTILINE) + request = aux[0].split(' ')[2] + + # We have two options from here, or the parameters are defined in the same line or the parameters are defined in + # following lines, next lines + for match in matches: + # Check that we have 1 group matched + if len(match.groups()) == 1: + aux = match.group(1) + + # Get the list of keys + params = aux.split(' ')[1:] + else: + raise Exception(f"Error, unexpected format, received: '{response_to_check}'") + + params = self.find_attributes_in_the_same_line(request_name=request, params=params) + elif ' ... ' in aux[1]: + request = aux[0].split(' ') + request = [x for x in request if x != ''][1] + # We are in the case that the attributes are in following lines + for i in range(1, len(aux)): + if ' ... ' in aux[i]: + regex = '(\s{4})*\s{4}\.{3}\s{4}(.*)' + param = re.match(pattern=regex, string=aux[i]) + if aux: + params.append(param.groups()[1]) + else: + break + + params = self.find_attributes_in_the_same_line(request_name=request, params=params) + + params = self.change_param_value(params) + + # Need to check if the key of the params is a variable (Cases 037_01, 037_03, 037_10) + params = self.resolve_variable_key_in_params(params) + + description = self.description[request](params) + return description + + def resolve_variable_key_in_params(self, params: dict) -> dict: + new_dict = dict() + + for old_key, value in params.items(): + if '${' in old_key: + new_key = self.change_param_value_iter(value=old_key) + new_dict[new_key] = value + else: + new_dict[old_key] = value + + return new_dict + + def find_attributes_in_the_same_line(self, request_name, params): + param = dict() + if len(self.op[request_name]['positions']) == 0: + # We do not know the position of the different parameters and the order in which they are received, + # therefore in these cases all the parameters have identified the corresponding name + # param = {x.split('=')[0]: self.get_value_simple(x.split('=')[1]) for x in params} + for i in range(0, len(params)): + x = params[i] + if x.find('=') != -1: + aux = x.split('=') + key = aux[0] + value = self.get_value_simple(aux[1]) + + param[key] = value + else: + key = self.op[request_name]['params'][i] + param[key] = x + else: + for i in range(0, len(self.op[request_name]['positions'])): + param_position = self.op[request_name]['positions'][i] + param_key = self.op[request_name]['params'][i] + param_value = self.get_value(params=params, param_position=param_position, param_key=param_key) + param[param_key] = param_value + + return param + + def find_attributes_next_lines(self, string, position, request_name): + aux = string[position+len(request_name)+1:].split('\n') + + params = list() + for a in range(0, len(aux)): + param = aux[a] + if param.startswith(" ..."): + params.append(param.split(' ')[-1]) + else: + break + + param = dict() + for i in range(0, len(self.op[request_name]['positions'])): + param_position = self.op[request_name]['positions'][i] - 1 + param_key = self.op[request_name]['params'][i] + param_value = self.get_value(params=params, param_position=param_position, param_key=param_key) + param[param_key] = param_value + + return param + + def change_param_value_iter(self, value): + try: + # Check if we can get the data from the current robot files + result = self.variables[value] + except KeyError: + try: + # Check if we can get the data from the apiutils file + result = self.apiutils_variables[value] + except KeyError: + try: + aux = re.findall(pattern=r'\$\{(.*)}', string=value) + if len(aux) != 0: + aux = aux[0] + else: + aux = value + result = self.config_file.get_variable(aux) + except KeyError: + try: + # aux = self.template_params_value[self.test_name] + aux = self.template_params_value[self.name] + result = aux[value] + + if result[:2] == "${": + result = self.change_param_value_iter(result) + except KeyError: + result = value + + return result + + def change_param_value(self, position): + for k, v in position.items(): + position[k] = self.change_param_value_iter(value=v) + + return position + + @staticmethod + def create_entity_selecting_content_type(kwargs) -> str: + if 'filename' in kwargs and 'content_type' in kwargs: + result = (f"Request Header['Content-Type'] set to '{kwargs['content_type']}' and\n " + f"payload defined in file: '{kwargs['filename']}'") + return result + else: + raise Exception(f"ERROR, expected filename and content_type attributes, but received {kwargs}") + + @staticmethod + def append_entity_attributes_with_parameters(kwargs) -> str: + expected_parameters = ['id', 'fragment_filename', 'content_type', 'options'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Append entity attributes with parameters:" + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'options': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def create_entity_from_file(kwargs) -> str: + if 'filename' in kwargs: + result = (f"Request creation of an entity from filename '{kwargs['filename']}'" + f" and Content-Type set to 'application/ld+json'") + return result + else: + raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + + @staticmethod + def batch_update_entities(kwargs) -> str: + if 'overwrite_option' not in kwargs: + kwargs['overwrite_option'] = '${EMPTY}' + + if 'entities' in kwargs: + result = (f"Request batch update operation over entity from filename '{kwargs['entities']}' " + f"with overwrite_option set to '{kwargs['overwrite_option']}' " + f"and Content-Type set to 'application/ld+json'") + return result + else: + raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + + @staticmethod + def batch_upsert_entities(kwargs) -> str: + if 'update_option' not in kwargs: + kwargs['update_option'] = 'replace' + + if 'entities_to_be_upserted' in kwargs: + result = (f"Request batch upsert operation over entity from filename '{kwargs['entities_to_be_upserted']}' " + f"with update_option set to '{kwargs['update_option']}' " + f"and Content-Type set to 'application/ld+json'") + return result + else: + raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + + def create_context_source_registration(kwargs) -> str: + if 'context_source_registration_payload' in kwargs: + result = (f"Create Context Source Registration Request with Content-Type set to 'application/ld+json' " + f"and payload set to '{kwargs['context_source_registration_payload']}'") + return result + else: + raise Exception(f"ERROR, expected filename and content_type attributes, but received {kwargs}") + + @staticmethod + def wait_for_notification(kwargs) -> str: + if 'timeout' in kwargs: + result = f"Waiting for notification with timeout set to '{kwargs['timeout']}'" + return result + else: + raise Exception(f"ERROR, expected filename and content_type attributes, but received {kwargs}") + + @staticmethod + def setup_initial_subscriptions(kwargs) -> str: + result = """a subscription with id set to ${subscriptionId} + and status equals 'active' + and timeInterval is set to '${timeInterval}' + and watchedAttributes is 'Empty' + and q is 'Empty' + and geoQ is 'Empty' + and with subscription.entity with type 'Building' + and notification.endpoint.accept is 'application/json' + + When the timeinterval is reached at ${timeInterval} seconds + the SUT needs to send out a notification to the client + sends a notification to the client every ${timeInterval} seconds""" + + return result + + @staticmethod + def create_subscription_from_file(kwargs) -> str: + if 'filename' in kwargs: + result = (f"Create Subscription Request with Header['Content-Type'] set to 'application/ld+json' and\n " + f"payload defined in file: '{kwargs['filename']}'") + return result + else: + raise Exception(f"ERROR, expected filename and content_type attributes, but received {kwargs}") + + @staticmethod + def batch_request_entities_from_file(kwargs) -> str: + if 'operation' in kwargs and 'filename' in kwargs: + result = (f"Batch Entity Delete Request with operation set to '{kwargs['operation']}', Content-Type set to 'application/ld+json', and body set to '{kwargs['filename']}") + return result + else: + raise Exception(f"ERROR, expected content_type attribute, but received {kwargs}") + + @staticmethod + def request_entity_from_file(kwargs) -> str: + if 'filename' in kwargs: + result = f"Request Entity from file with filename set to '{kwargs['filename']}' and content-type set to 'application/ld+json'" + return result + else: + raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + + @staticmethod + def batch_create_entities(kwargs) -> str: + if 'content_type' in kwargs: + result = (f"Request Header['Content-Type'] set to '{kwargs['content_type']}' and\n " + f"payload set to a list of entities to be created") + return result + else: + raise Exception(f"ERROR, expected content_type attribute, but received {kwargs}") + + @staticmethod + def create_context_source_registration_with_return(kwargs) -> str: + if 'filename' in kwargs: + result = (f"Request Header['Content-Type'] set to 'application/ld+json' and\n " + f"payload defined in file: '{kwargs['filename']}'") + return result + else: + raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + + @staticmethod + def query_entity(kwargs) -> str: + expected_parameters = ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Get Entity Request:" + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'context': + response = (f"{response} and\n Query Parameter: Link set to " + f"'<${value}>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'") + case 'geoproperty': + response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" + case 'options': + response = f"{response} and\n Query Parameter: options set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def modify_attribute_instance_from_temporal_entity(kwargs) -> str: + expected_parameters = ['temporal_entity_id', 'attributeId', 'instanceId', 'fragment_filename', 'content_type', 'context'] + + if 'context' not in kwargs: + kwargs['context'] = '${EMPTY}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Modify Attribute Instance from Temporal Entity:" + for key, value in kwargs.items(): + match key: + case 'temporal_entity_id': + response = f"{response} and\n Query Parameter: temporal_entity_id set to '{value}'" + case 'attributeId': + response = f"{response} and\n Query Parameter: attributeId set to '{value}'" + case 'instanceId': + response = f"{response} and\n Query Parameter: instanceId set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: fragment_filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def delete_attribute_instance_from_temporal_entity(kwargs) -> str: + expected_parameters = ['temporal_entity_id', 'attributeId', 'instanceId', 'content_type', 'context'] + + if 'context' not in kwargs: + kwargs['context'] = '${EMPTY}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Delete Attribute Instance from Temporal Entity:" + for key, value in kwargs.items(): + match key: + case 'temporal_entity_id': + response = f"{response} and\n Query Parameter: temporal_entity_id set to '{value}'" + case 'attributeId': + response = f"{response} and\n Query Parameter: attributeId set to '{value}'" + case 'instanceId': + response = f"{response} and\n Query Parameter: instanceId set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def delete_attribute_from_temporal_entity(kwargs) -> str: + expected_parameters = ['entityId', 'attributeId', 'content_type', 'datasetId', 'deleteAll', 'context'] + + if 'context' not in kwargs: + kwargs['context'] = '${EMPTY}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Delete Attribute From Temporal Entity:" + for key, value in kwargs.items(): + match key: + case 'entityId': + response = f"{response} and\n Query Parameter: entityId set to '{value}'" + case 'attributeId': + response = f"{response} and\n Query Parameter: attributeId set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'datasetId': + response = f"{response} and\n Query Parameter: datasetId set to '{value}'" + case 'deleteAll': + response = f"{response} and\n Query Parameter: deleteAll set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def create_or_update_temporal_representation_of_entity_selecting_content_type(kwargs) -> str: + expected_parameters = ['temporal_entity_representation_id', 'filename', 'content_type', 'accept'] + + if 'accept' not in kwargs: + kwargs['accept'] = '${EMPTY}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Create or Update Temporal Representation of Entity Selecting Content Type:" + for key, value in kwargs.items(): + match key: + case 'temporal_entity_representation_id': + response = f"{response} and\n Query Parameter: temporal_entity_representation_id set to '{value}'" + case 'filename': + response = f"{response} and\n Query Parameter: filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def create_temporal_representation_of_entity_selecting_content_type(kwargs) -> str: + expected_parameters = ['filename', 'content_type'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Create Temporal Representation of Entity Selecting Content Type:" + for key, value in kwargs.items(): + match key: + case 'filename': + response = f"{response} and\n Query Parameter: filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def delete_entity_attributes(kwargs) -> str: + expected_parameters = ['entityId', 'attributeId', 'datasetId', 'deleteAll', 'context'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Delete Entity Attributes:" + for key, value in kwargs.items(): + match key: + case 'entityId': + response = f"{response} and\n Query Parameter: entityId set to '{value}'" + case 'attributeId': + response = f"{response} and\n Query Parameter: attributeId set to '{value}'" + case 'datasetId': + response = f"{response} and\n Query Parameter: datasetId set to '{value}'" + case 'deleteAll': + response = f"{response} and\n Query Parameter: deleteAll set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_attributes(kwargs) -> str: + expected_parameters = ['details', 'accept', 'context'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Retrieve attributes:" + for key, value in kwargs.items(): + match key: + case 'details': + response = f"{response} and\n Query Parameter: details set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def batch_delete_entities(kwargs) -> str: + expected_parameters = ['entities_ids_to_be_deleted', 'teardown'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Batch Delete Entities:" + for key, value in kwargs.items(): + match key: + case 'entities_ids_to_be_deleted': + response = f"{response} and\n Query Parameter: entities_ids_to_be_deleted set to '{value}'" + case 'teardown': + response = f"{response} and\n Query Parameter: teardown set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_entity_types(kwargs) -> str: + expected_parameters = ['details', 'accept', 'context'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Retrieve entity types:" + for key, value in kwargs.items(): + match key: + case 'details': + response = f"{response} and\n Query Parameter: details set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_subscription(kwargs) -> str: + # if 'accept' in kwargs: + # return f"Request a subscription\nHeader['Accept'] set to '{kwargs['accept']}'" + # else: + # return "Request a subscription" + expected_parameters = ['id', 'accept', 'context', 'content_type'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Subscription Retrieve with the following data:" + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + def query_context_source_registrations_with_return(kwargs) -> str: + if 'type' in kwargs and 'accept' in kwargs: + result = "Request a Context Source Registration with Return" + + if kwargs['type'] != '': + result = f"{result}\nEntity Type set to '{kwargs['type']}'" + + if kwargs['accept'] != '': + result = f"{result}\nHeader['Accept'] set to '{kwargs['accept']}'" + else: + result = "Request a Context Source Registration with Return" + + return result + + def query_temporal_representation_of_entities_with_return(kwargs) -> str: + return "Request a Temporal Representation of Entities with Return" + + def partial_update_entity_attributes(kwargs) -> str: + expected_parameters = ['entityId', 'attributeId', 'fragment_filename', 'content_type', 'accept', 'context'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Request Partial Update Entity Attributes" + for key, value in kwargs.items(): + match key: + case 'entityId': + response = f"{response} and\n Query Parameter: entityId set to '{value}'" + case 'attributeId': + response = f"{response} and\n Query Parameter: AttributeId set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: fragment_filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + def update_subscription(kwargs) -> str: + if 'context' in kwargs and 'content' in kwargs and 'filename' in kwargs: + context = kwargs['context'] + if context == '': + return (f"Request Update Subscription and \n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + return (f"Request Update Subscription and \n" + f"Header['Link'] contain the context '{kwargs['context']}' and\n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + raise Exception(f"ERROR, expected context attribute, but received {kwargs}") + + @staticmethod + def query_context_source_registration_subscriptions(kwargs) -> str: + expected_parameters = ['context', 'limit', 'page', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Query Context Source Registration Subscriptions" + for key, value in kwargs.items(): + match key: + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'limit': + response = f"{response} and\n Query Parameter: limit set to '{value}'" + case 'page': + response = f"{response} and\n Query Parameter: page set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def query_temporal_representation_of_entities(kwargs) -> str: + # This function is a little bit special because we have a number of parameters not always defined and not always + # in the same position, so we make a different analysis to extract the values + expected_parameters = ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', + 'ngsild_query', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timerel', 'timeAt', + 'attrs', 'limit', 'lastN', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Query Temporal Representation of Entities" + for key, value in kwargs.items(): + match key: + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'entity_types': + response = f"{response} and\n Query Parameter: entity_types set to '{value}'" + case 'entity_ids': + response = f"{response} and\n Query Parameter: entity_ids set to '{value}'" + case 'entity_id_pattern': + response = f"{response} and\n Query Parameter: entity_id_pattern set to '{value}'" + case 'ngsild_query': + response = f"{response} and\n Query Parameter: ngsild_query set to '{value}'" + case 'csf': + response = f"{response} and\n Query Parameter: csf set to '{value}'" + case 'georel': + response = f"{response} and\n Query Parameter: georel set to '{value}'" + case 'geometry': + response = f"{response} and\n Query Parameter: geometry set to '{value}'" + case 'coordinates': + response = f"{response} and\n Query Parameter: coordinates set to '{value}'" + case 'geoproperty': + response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" + case 'timerel': + response = f"{response} and\n Query Parameter: timerel set to '{value}'" + case 'timeAt': + response = f"{response} and\n Query Parameter: timeAt set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'limit': + response = f"{response} and\n Query Parameter: limit set to '{value}'" + case 'lastN': + value = re.search(pattern=r'\d+', string=value).group() + response = f"{response} and\n Query Parameter: lastN set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_temporal_representation_of_entity(kwargs) -> str: + expected_parameters = ['temporal_entity_representation_id', 'attrs', 'options', + 'context', 'timerel', 'timeAt', + 'endTimeAt', 'lastN', 'accept'] + result = [x for x in kwargs if x not in expected_parameters] + response = "Retrieve Temporal Representation of Entity" + for key, value in kwargs.items(): + match key: + case 'temporal_entity_representation_id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'options': + response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'timerel': + response = f"{response} and\n Query Parameter: timerel set to '{value}'" + case 'timeAt': + response = f"{response} and\n Query Parameter: timeAt set to '{value}'" + case 'endTimeAt': + response = f"{response} and\n Query Parameter: endTimeAt set to '{value}'" + case 'lastN': + value = re.search(pattern=r'\d+', string=value).group() + response = f"{response} and\n Query Parameter: lastN set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_attribute(kwargs) -> str: + if 'attribute_name' in kwargs: + return f"Retrieve Attribute with attributeName set to '{kwargs['attribute_name']}'" + + @staticmethod + def retrieve_entity_type(kwargs) -> str: + result = "Retrieve Entity Type" + if 'type' in kwargs: + result = f"{result}, with type set to '{kwargs['type']}'" + + if 'context' in kwargs and kwargs['context'] != '': + result = f"{result}, with Header['Link'] containing '{kwargs['context']}'" + + if 'type' not in kwargs or 'context' not in kwargs: + raise Exception(f"ERROR, expected type or context attributes, received '{kwargs}'") + + return result + + @staticmethod + def query_entities(kwargs) -> str: + expected_parameters = ['entity_ids', 'entity_types', 'accept', + 'attrs', 'context', 'geoproperty', + 'options', 'limit', 'entity_id_pattern', + 'georel', 'coordinates', 'geometry'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Get Entities Request:" + for key, value in kwargs.items(): + match key: + case 'entity_ids': + response = f"{response} and\n Query Parameter: entity_ids set to '{value}'" + case 'entity_types': + response = f"{response} and\n Query Parameter: entity_types set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'context': + response = (f"{response} and\n Query Parameter: Link set to " + f"'<${value}>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'") + case 'geoproperty': + response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" + case 'options': + response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'limit': + response = f"{response} and\n Query Parameter: limit set to '{value}'" + case 'entity_id_pattern': + response = f"{response} and\n Query Parameter: entity_id_pattern set to '{value}'" + case 'georel': + response = f"{response} and\n Query Parameter: georel set to '{value}'" + case 'coordinates': + response = f"{response} and\n Query Parameter: coordinates set to '{value}'" + case 'geometry': + response = f"{response} and\n Query Parameter: geometry set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + def query_entities_via_post(kwargs) -> str: + expected_parameters = ['entity_id', 'entity_type', 'content_type', 'accept', + 'attrs', 'entity_id_pattern', 'geometry_property'] + + if 'content_type' not in kwargs: + kwargs['content_type'] = 'application/json' + + if 'accept' not in kwargs: + kwargs['accept'] = 'application/json' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Get Entities Via POST Request:" + for key, value in kwargs.items(): + match key: + case 'entity_id': + response = f"{response} and\n Query Parameter: entity_ids set to '{value}'" + case 'entity_type': + response = f"{response} and\n Query Parameter: entity_types set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'geometry_property': + response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" + case 'entity_id_pattern': + response = f"{response} and\n Query Parameter: entity_id_pattern set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + def query_temporal_representation_of_entities_via_post(kwargs) -> str: + expected_parameters = ['query_file_name', 'content_type', 'context'] + + if 'content_type' not in kwargs: + kwargs['content_type'] = 'application/json' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Query Temporal Representation of Entities Via POST Request:" + for key, value in kwargs.items(): + match key: + case 'query_file_name': + response = f"{response} and\n Query Parameter: query_file_name set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + case 'context': + response = (f"{response} and\n Query Parameter: Link set to " + f"'<${value}>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'") + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + + @staticmethod + def retrieve_entity_by_id(kwargs) -> str: + expected_parameters = ['id', 'accept', 'context'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Request Retrieve Entity by Id' + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def delete_entity_by_id(kwargs) -> str: + if 'id' in kwargs: + return f"Delete Entity Request with id set to '{kwargs['id']}'" + + @staticmethod + def delete_subscription(kwargs) -> str: + if 'id' in kwargs: + return f"Delete Subscription with id set to '{kwargs['id']}'" + + @staticmethod + def query_subscriptions(kwargs) -> str: + expected_parameters = ['context', 'limit', 'offset', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Query Subscription Request with data:' + for key, value in kwargs.items(): + match key: + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'limit': + response = f"{response} and\n Query Parameter: limit set to '{value}'" + case 'offset': + response = f"{response} and\n Query Parameter: offset set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def retrieve_context_source_registration_subscription(kwargs) -> str: + expected_parameters = ['subscription_id', 'context', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Retrieve Context Source Registration Subscription with data:' + for key, value in kwargs.items(): + match key: + case 'subscription_id': + response = f"{response} and\n Query Parameter: subscription id set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def delete_context_source_registration_with_return(kwargs) -> str: + if 'id' in kwargs: + return f"Delete Context Source Registration with id set to '{kwargs['id']}'" + + @staticmethod + def update_context_source_registration(kwargs) -> str: + if 'context_source_registration_id' in kwargs and 'update_fragment' in kwargs: + return (f"Update Context Source Registration " + f"with CSR Id set to '{kwargs['context_source_registration_id']}' and " + f"subscription update fragment set to '{kwargs['update_fragment']}'") + else: + raise Exception(f"ERROR, expected 'context_source_registration_id' and 'update_fragment'" + f" but received: {kwargs}") + + @staticmethod + def update_context_source_registration_subscription(kwargs) -> str: + if 'subscription_id' in kwargs and 'subscription_update_fragment' in kwargs: + return (f"Update Context Source Registration Subscription " + f"with subscription id set to '{kwargs['subscription_id']}' and " + f"subscription update fragment set to '{kwargs['subscription_update_fragment']}'") + else: + raise Exception(f"ERROR, expected 'subscription_id' and 'subscription_update_fragment' but received: {kwargs}") + + @staticmethod + def update_context_source_registration_subscription_from_file(kwargs) -> str: + if 'subscription_id' in kwargs and 'subscription_update_fragment' in kwargs: + return (f"Update Context Source Registration Subscription from file " + f"with subscription id set to '{kwargs['subscription_id']}' and " + f"subscription update fragment set to '{kwargs['subscription_update_fragment']}'") + else: + raise Exception(f"ERROR, expected 'subscription_id' and 'subscription_update_fragment' but received: {kwargs}") + + @staticmethod + def retrieve_context_source_registration(kwargs) -> str: + expected_parameters = ['context_source_registration_id', 'context', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Retrieve Context Source Registration with data:' + for key, value in kwargs.items(): + match key: + case 'context_source_registration_id': + response = f"{response} and\n Query Parameter: context source registration id set to '{value}'" + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def query_context_source_registrations(kwargs) -> str: + expected_parameters = ['context', 'id', 'type', 'attrs', + 'q', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timeproperty', 'timerel', + 'timeAt', 'limit', 'page', 'accept'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Retrieve Temporal Representation of Entity" + for key, value in kwargs.items(): + match key: + case 'context': + response = f"{response} and\n Query Parameter: context set to '{value}'" + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'type': + response = f"{response} and\n Query Parameter: type set to '{value}'" + case 'attrs': + response = f"{response} and\n Query Parameter: attrs set to '{value}'" + case 'q': + response = f"{response} and\n Query Parameter: q set to '{value}'" + case 'csf': + response = f"{response} and\n Query Parameter: csf set to '{value}'" + case 'georel': + response = f"{response} and\n Query Parameter: georel set to '{value}'" + case 'geometry': + response = f"{response} and\n Query Parameter: geometry set to '{value}'" + case 'coordinates': + response = f"{response} and\n Query Parameter: coordinates set to '{value}'" + case 'geoproperty': + response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" + case 'timeproperty': + response = f"{response} and\n Query Parameter: timeproperty set to '{value}'" + case 'timerel': + response = f"{response} and\n Query Parameter: timerel set to '{value}'" + case 'timeAt': + response = f"{response} and\n Query Parameter: timeAt set to '{value}'" + case 'limit': + response = f"{response} and\n Query Parameter: limit set to '{value}'" + case 'page': + response = f"{response} and\n Query Parameter: page set to '{value}'" + case 'accept': + response = f"{response} and\n Query Parameter: accept set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def update_context_source_registration_with_return(kwargs) -> str: + if 'id' in kwargs and 'filename' in kwargs and 'content' in kwargs: + return (f"Update Context Source Registration with id set to '{kwargs['id']}' " + f"and registration update fragment set to '{kwargs['filename']}' " + f"and content-type set to '{kwargs['content']}'") + + @staticmethod + def delete_temporal_representation_of_entity_with_returning_response(kwargs) -> str: + if 'id' in kwargs: + return f"Delete Temporal Representation Of Entity With Returning Response with id set to '{kwargs['id']}'" + + @staticmethod + def retrieve_context_source_registration_subscription_2(kwargs) -> str: + if 'id' in kwargs: + return f"Retrieve Context Source Registration Subscription with id set to '{kwargs['id']}'" + else: + raise Exception(f"ERROR, expected 'id' but received: '{kwargs}'") + + @staticmethod + def delete_context_source_registration_subscription(kwargs) -> str: + if 'id' in kwargs: + return f"Delete Context Source Registration Subscription with id set to '{kwargs['id']}'" + else: + raise Exception(f"ERROR, expected 'id' but received: '{kwargs}'") + + @staticmethod + def create_context_source_registration_subscription(kwargs) -> str: + if 'filename' in kwargs: + return (f"Create Context Source Registration Subscription with filename set to '{kwargs['filename']}', " + f"accept set to '${{EMPTY}}', and content-type set to 'application/ld+json'") + else: + raise Exception(f"ERROR, expected 'filename' but received: '{kwargs}'") + + @staticmethod + def append_attribute_to_temporal_entity(kwargs) -> str: + expected_parameters = ['id', 'fragment_filename', 'content_type'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Append Attribute to Temporal Entity' + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: fragment_filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def append_entity_attributes(kwargs) -> str: + expected_parameters = ['id', 'fragment_filename', 'content_type'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Append Entity Attributes' + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: fragment_filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def update_entity_attributes(kwargs) -> str: + expected_parameters = ['id', 'fragment_filename', 'content_type'] + + result = [x for x in kwargs if x not in expected_parameters] + response = 'Update Entity Attributes' + for key, value in kwargs.items(): + match key: + case 'id': + response = f"{response} and\n Query Parameter: id set to '{value}'" + case 'fragment_filename': + response = f"{response} and\n Query Parameter: fragment_filename set to '{value}'" + case 'content_type': + response = f"{response} and\n Query Parameter: content_type set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + def get_value(self, params, param_position, param_key): + data = [x for x in params if f'{param_key}=' in x] + + if len(data) == 1: + # The name of the attribute is passed to the function in the form attribute=value + data = data[0] + data = data.split('=') + if data[0] != param_key: + return '' + + data = data[1] + elif len(data) == 0: + # There is no attribute=something therefore we have to apply the position + try: + data = params[param_position] + + # Workaround + if 'accept' in data and param_key != 'accept': + data = '' + except IndexError: + return '' + + return self.get_value_simple(data=data) + + def get_value_simple(self, data): + try: + value = self.variables[data] + return value + except KeyError: + try: + value = self.apiutils_variables[data] + return value + except KeyError: + try: + value = self.config_file.get_variable(variable=data) + return value + except KeyError: + try: + aux = self.template_params_value[self.name] + value = aux[data] + return value + except KeyError: + return data + diff --git a/doc/files/CommonBehaviours/043_01.json b/doc/files/CommonBehaviours/043_01.json new file mode 100644 index 0000000000000000000000000000000000000000..6de10553c61f5aff6c4c67039625d24d2002d3eb --- /dev/null +++ b/doc/files/CommonBehaviours/043_01.json @@ -0,0 +1,100 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/043_01", + "test_objective": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.2.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_2_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "043_01_01 Create entity", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/043_01_01", + "doc": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)", + "tags": [ + "5_2_2", + "e-create" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 503 and\n Create Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and\n Create Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-unretrievable-context-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "043_01_02 Create subscription", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/043_01_02", + "doc": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription)", + "tags": [ + "5_2_2", + "sub-create" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 503 and\n Create Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and\n Create Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-unretrievable-context-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "043_01_03 Create Temporal Representation of Entities", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/043_01_03", + "doc": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)", + "tags": [ + "5_2_2", + "te-create" + ], + "setup": null, + "teardown": "Delete Temporal Representation Of Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 503 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'bus-temporal-representation-unretrievable-context-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + }, + { + "name": "043_01_04 Batch entity create", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/043_01_04", + "doc": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create)", + "tags": [ + "5_2_2", + "be-create" + ], + "setup": null, + "teardown": "Batch Delete Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 503 and\n Batch Create Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and\n Batch Create Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "043_01_05 Create context source registration", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/043_01_05", + "doc": "Verify receiving 503 \u2013 LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration)", + "tags": [ + "5_2_2", + "csr-create" + ], + "setup": null, + "teardown": "Delete Context Source Registration", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Context Source Registration With Return with Response Status Code set to 503\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when", + "endpoint", + "then" + ], + "robotpath": "CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable", + "robotfile": "043_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_01.json b/doc/files/CommonBehaviours/044_01.json new file mode 100644 index 0000000000000000000000000000000000000000..08dc3317a21db06c6dfa336d639571e7757f83b5 --- /dev/null +++ b/doc/files/CommonBehaviours/044_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/044_01", + "test_objective": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "044_01_01 endpoint /entities/{entityId}/attrs/{attrId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/044_01_01", + "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "tags": [ + "6_3_4", + "ea-partial-update" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Partial Update Entity Attributes with Response Status Code set to 204\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'brandName' and\n Query Parameter: fragment_filename set to 'vehicle-brandname-fragment.json' and\n Query Parameter: content_type set to 'application/merge-patch+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "CommonBehaviours/CommonResponses/VerifyMergePatchJson", + "robotfile": "044_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_02.json b/doc/files/CommonBehaviours/044_02.json new file mode 100644 index 0000000000000000000000000000000000000000..3ffd349fc10d45440c894c81ee202d24c186b980 --- /dev/null +++ b/doc/files/CommonBehaviours/044_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/044_02", + "test_objective": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Subscription ${subscription} \n with an id set to ${subscription_id} \n}", + "test_cases": [ + { + "name": "044_02_01 Endpoint /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/044_02_01", + "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "tags": [ + "6_3_4", + "sub-update" + ], + "setup": "Create Initial Subscription", + "teardown": "Delete Initial Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Update Subscription with Response Status Code set to 204\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/merge-patch+json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "CommonBehaviours/CommonResponses/VerifyMergePatchJson", + "robotfile": "044_02" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/045_01.json b/doc/files/CommonBehaviours/045_01.json new file mode 100644 index 0000000000000000000000000000000000000000..26ec1a4044c6d64865d0942244e9f3fd11b76ef8 --- /dev/null +++ b/doc/files/CommonBehaviours/045_01.json @@ -0,0 +1,84 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/045_01", + "test_objective": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "045_01_01 Endpoint /entities/{entityId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/045_01_01", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/entities/{entityId})", + "tags": [ + "6_3_4", + "e-query" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 200 and\n Create Entity Selecting Content Type with Response Header: Content-Type set to application/json and\n Notification with Response Header: Link is not Empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${id}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: accept set to '*/*'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "045_01_02 Endpoint /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/045_01_02", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 201 and\n Create Subscription with Response Status Code set to 200 and\n Create Subscription with Response Header: Content-Type set to application/json and\n Notification with Response Header: Link is not Empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${id}' and\n Query Parameter: accept set to '*/*'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "045_01_03 Endpoint /csourceRegistrations/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/045_01_03", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/csourceRegistrations/)", + "tags": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": "Delete Context Source Registration", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Create Context Source Registration With Return with Response Status Code set to 200 and\n Create Context Source Registration With Return with Response Header: Content-Type set to application/json and\n Notification with Response Header: Link is not Empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Vehicle'\nHeader['Accept'] set to '*/*'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "045_01_04 Endpoint /temporal/entities", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/045_01_04", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/temporal/entities)", + "tags": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": "Delete Temporal Representation Of Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 200 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Header: Content-Type set to application/json and\n Notification with Response Header: Link is not Empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Request a Temporal Representation of Entities with Return\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when", + "endpoint", + "then" + ], + "robotpath": "CommonBehaviours/CommonResponses/VerifyGETWithoutAccept", + "robotfile": "045_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/048_01.json b/doc/files/CommonBehaviours/048_01.json new file mode 100644 index 0000000000000000000000000000000000000000..d5e4a14d35de68e3662d488a94411dff378b86ec --- /dev/null +++ b/doc/files/CommonBehaviours/048_01.json @@ -0,0 +1,117 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/048_01", + "test_objective": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "048_01_01 Endpoint patch /entities/{entityId}/attrs/{attrId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_01", + "doc": "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": [ + "6_3_4", + "ea-partial-update" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Partial Update Entity Attributes with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-brandname-fragment.jsonld' and\n Query Parameter: content_type set to 'application/xml'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "048_01_02 Endpoint patch /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_02", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (patch /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-update" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Update Subscription with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/xml' and\nPayload defined in file 'csourceSubscriptions/fragments/subscription-update-sample.jsonld'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + }, + { + "name": "048_01_03 Endpoint post /entities/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_03", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /entities/)", + "tags": [ + "6_3_4", + "e-create" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Entity Selecting Content Type with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "048_01_04 Endpoint post /subscriptions/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_04", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /subscriptions/)", + "tags": [ + "6_3_4", + "sub-create" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Subscription with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload defined in file: 'csourceSubscriptions/subscription-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "048_01_05 Endpoint post /entityOperations/create", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_05", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /entityOperations/create)", + "tags": [ + "6_3_4", + "be-create" + ], + "setup": null, + "teardown": "Batch Delete Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Batch Create Entities with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "048_01_06 Endpoint post /temporal/entities/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/048_01_06", + "doc": "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": [ + "6_3_4", + "te-create" + ], + "setup": null, + "teardown": "Delete Temporal Representation Of Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/xml' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when", + "endpoint", + "http_verb", + "then" + ], + "robotpath": "CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType", + "robotfile": "048_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/049_01.json b/doc/files/CommonBehaviours/049_01.json new file mode 100644 index 0000000000000000000000000000000000000000..4cec1af70c40ed2d3b2ab0bf0d5ffb3e522c0046 --- /dev/null +++ b/doc/files/CommonBehaviours/049_01.json @@ -0,0 +1,100 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/049_01", + "test_objective": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "049_01_01 Endpoint get /entities/{entityId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_01_01", + "doc": "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": [ + "6_3_4", + "e-query" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Entity with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/xml'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "049_01_02 Endpoint get /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_01_02", + "doc": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\" (get /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Subscription with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${id}' and\n Query Parameter: accept set to 'application/xml'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "049_01_03 Endpoint get /csourceRegistrations/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_01_03", + "doc": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\" (get /csourceRegistrations/)", + "tags": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Context Source Registrations With Return with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Building'\nHeader['Accept'] set to 'application/xml'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "049_01_04 Endpoint get /csourceSubscriptions/", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_01_04", + "doc": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\" (get /csourceSubscriptions/)", + "tags": [ + "6_3_4", + "csrsub-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Context Source Registration Subscriptions with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: accept set to 'application/xml'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "049_01_05 Endpoint get /temporal/entities", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_01_05", + "doc": "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": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Temporal Representation Of Entities with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-08-01T12:05:00Z' and\n Query Parameter: accept set to 'application/xml'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when", + "endpoint", + "then" + ], + "robotpath": "CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType", + "robotfile": "049_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/049_02.json b/doc/files/CommonBehaviours/049_02.json new file mode 100644 index 0000000000000000000000000000000000000000..2fd1ec2e1289f9835d73c8bc4b7834a780412cd2 --- /dev/null +++ b/doc/files/CommonBehaviours/049_02.json @@ -0,0 +1,68 @@ +{ + "tp_id": "TP/NGSI-LD/CB/HTTP/049_02", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "049_02_01 Retrieve subscription by id", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_02_01", + "doc": "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\" (get /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Subscription with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${id}' and\n Query Parameter: accept set to 'application/geo+json'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "049_02_02 Query temporal entities", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_02_02", + "doc": "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\" (get /temporal/entities)", + "tags": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Temporal Representation Of Entities with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-08-01T12:05:00Z' and\n Query Parameter: accept set to 'application/geo+json'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "049_02_03 Query context source registration", + "permutation_tp_id": "TP/NGSI-LD/CB/HTTP/049_02_03", + "doc": "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\" (get /csourceRegistrations)", + "tags": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Context Source Registrations With Return with Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Building'\nHeader['Accept'] set to 'application/geo+json'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when", + "endpoint", + "then" + ], + "robotpath": "CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType", + "robotfile": "049_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_01_01.json b/doc/files/ContextInformation/Consumption/018_01_01.json new file mode 100644 index 0000000000000000000000000000000000000000..aa80c9cef930780edd5bced22e5e0cd13073e4e8 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_01", + "test_objective": "Check that you can get an entity by id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [ + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_01_01 Get an entity by id", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_01", + "doc": "Check that you can get an entity by id", + "tags": [ + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-expectation.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_01_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_01_02.json b/doc/files/ContextInformation/Consumption/018_01_02.json new file mode 100644 index 0000000000000000000000000000000000000000..bbf1057adfba744a09a9ea631e57b48490978dce --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_02", + "test_objective": "Check that you can query some attributes from an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [ + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_01_02 Query some attributes from an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_02", + "doc": "Check that you can query some attributes from an entity", + "tags": [ + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-query-expectation.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_01_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_01_03.json b/doc/files/ContextInformation/Consumption/018_01_03.json new file mode 100644 index 0000000000000000000000000000000000000000..0c358360cf46e2ba739dc1fefcd3b5c180842658 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_03", + "test_objective": "Check that you can query the geometry property from an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [ + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_01_03 Query the geometry property from an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_01_03", + "doc": "Check that you can query the geometry property from an entity", + "tags": [ + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-geoproperty-query-expectation.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: geoproperty set to 'location'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_01_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_02.json b/doc/files/ContextInformation/Consumption/018_02.json new file mode 100644 index 0000000000000000000000000000000000000000..68c66c6decf3b55d4cea35e15abcdd87138e8235 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_02", + "test_objective": "Check that you cannot get an entity with invalid id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_02_01 Get an entity if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_02_01", + "doc": "Check that you cannot get an entity with invalid/missing id", + "tags": [ + "e-retrieve", + "5_7_1" + ], + "setup": null, + "teardown": null, + "template": "Get Entity With Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 400 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to 'thisisaninvaliduri' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_03_01.json b/doc/files/ContextInformation/Consumption/018_03_01.json new file mode 100644 index 0000000000000000000000000000000000000000..c99b21951715888ac4ad421bc98b1d30cee9eea7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_03_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_03_01", + "test_objective": "Check that you cannot get an entity if the entity id is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_03_01 Get an entity if the Entity Id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_03_01", + "doc": "Check that you cannot get an entity if the entity id or attributes are not known to the system", + "tags": [ + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 404 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Query Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_03_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_03_02.json b/doc/files/ContextInformation/Consumption/018_03_02.json new file mode 100644 index 0000000000000000000000000000000000000000..670b0115d24897ff634ec957b1bdce7d33944c20 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_03_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_03_02", + "test_objective": "Check that you cannot get an entity if an attribute is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [ + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_03_02 Get an entity if an attribute is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_03_02", + "doc": "Check that you cannot get an entity if an attribute is not known to the system", + "tags": [ + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entity with Response Status Code set to 404 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Query Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_03_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_04.json b/doc/files/ContextInformation/Consumption/018_04.json new file mode 100644 index 0000000000000000000000000000000000000000..2c1385c2b5fa2e8f068cb033e63a11dad1d5e66d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_04.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_04", + "test_objective": "Check that the queried entity by Id can be returned in a simplified representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_04_01 Get an entity in a simplified representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_04_01", + "doc": "Check that the queried entity by Id can be returned in a simplified representation", + "tags": [ + "6_3_7", + "e-retrieve" + ], + "setup": null, + "teardown": "Delete Created Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified-expectation.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: options set to 'keyValues'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_05.json b/doc/files/ContextInformation/Consumption/018_05.json new file mode 100644 index 0000000000000000000000000000000000000000..0a4d739249e555f13c6aae6a5136fe7c1b37f261 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_05.json @@ -0,0 +1,54 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_05", + "test_objective": "Check that the queried entity by id can be returned in a GeoJSON format", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [ + "Create Initial Entity", + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_05_01 Simplified", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_05_01", + "doc": "Check that the queried entity by id can be returned in a GeoJSON format", + "tags": [ + "6_3_7", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity In GeoJSON Representation", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-location-attribute-simplified.geojson'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: options set to 'keyValues' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_05_02 Normalized", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_05_02", + "doc": "Check that the queried entity by id can be returned in a GeoJSON format", + "tags": [ + "6_3_7", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity In GeoJSON Representation", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-location-attribute-normalized.geojson'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_06.json b/doc/files/ContextInformation/Consumption/018_06.json new file mode 100644 index 0000000000000000000000000000000000000000..5e3077bfa47f6b5cd8d2ad8d140b3c47eb40ebe5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_06.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_06", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "018_06_01 EmptyJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_06_01", + "doc": "Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present", + "tags": [ + "6_3_5", + "e-retrieve" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Created Entity", + "template": "Review JSON-LD Resolution When retrieving an entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-sample-expanded-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: Link set to '<$${EMPTY}>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_06_02 CreationTimeJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_06_02", + "doc": "Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present", + "tags": [ + "6_3_5", + "e-retrieve" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Created Entity", + "template": "Review JSON-LD Resolution When retrieving an entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-sample-compacted-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_01_01.json b/doc/files/ContextInformation/Consumption/019_01_01.json new file mode 100644 index 0000000000000000000000000000000000000000..c018bd02fe92de49bd432de992fd0893c827df6f --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", + "test_objective": "Check that you can query several entities based on ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_01_01 Query several entities based on ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", + "doc": "Check that you can query several entities based on ids", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_01_02.json b/doc/files/ContextInformation/Consumption/019_01_02.json new file mode 100644 index 0000000000000000000000000000000000000000..28789a55e526b7caab5545aed018ea0b151e8878 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_02", + "test_objective": "Check that you can query several entities based on the entities types", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_01_02 Query several entities based on the entities types", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_02", + "doc": "Check that you can query several entities based on the entities types", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'expectation_filename' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_01_03.json b/doc/files/ContextInformation/Consumption/019_01_03.json new file mode 100644 index 0000000000000000000000000000000000000000..61a63179aed9e96ea66b622fdc9001e5361e5815 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", + "test_objective": "Check that you can query several entities based on the given id pattern", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_01_03 Query several entities based on the given id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", + "doc": "Check that you can query several entities based on the given id pattern", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_id_pattern set to 'urn:ngsi-ld:Building:.*' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_01_04.json b/doc/files/ContextInformation/Consumption/019_01_04.json new file mode 100644 index 0000000000000000000000000000000000000000..13c69b48f62cebcf0f085ac087141161b5edc21f --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", + "test_objective": "Check that you can query several entities based on attribute names", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_01_04 Query several entities based on attribute names", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", + "doc": "Check that you can query several entities based on attribute names", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_01_05.json b/doc/files/ContextInformation/Consumption/019_01_05.json new file mode 100644 index 0000000000000000000000000000000000000000..8477e66bd5c90504b215d67985dac230427578a8 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_05.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_05", + "test_objective": "Check that you can query entities based on a geoquery", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_01_05 Query several entities based on a geoquery", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_05", + "doc": "Check that you can query entities based on a geoquery", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: georel set to 'equals' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_02_01.json b/doc/files/ContextInformation/Consumption/019_02_01.json new file mode 100644 index 0000000000000000000000000000000000000000..dc6b36fd7391467ab1f9eb4a809070d9536f3eb1 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", + "test_objective": "Check that you can query one entity via POST Interaction based on id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_01 Query one entity via POST Interaction based on id", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", + "doc": "Check that you can query one entity via POST Interaction based on id", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_ids set to '${first_entity_id}' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_02_02.json b/doc/files/ContextInformation/Consumption/019_02_02.json new file mode 100644 index 0000000000000000000000000000000000000000..9f61b5b0dc586286aab93df1700aa193b55a362d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_02", + "test_objective": "Check that you can query several entities via POST Interaction based on the entity type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_02 Query several entities via POST Interaction based on the entities types", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_02", + "doc": "Check that you can query several entities via POST Interaction based on the entity type", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'expectation_filename' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Vehicle' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_02_03.json b/doc/files/ContextInformation/Consumption/019_02_03.json new file mode 100644 index 0000000000000000000000000000000000000000..e87f26b0ee972243cf9b3152f8df70fb771e4b01 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", + "test_objective": "Check that you can query several entities via POST Interaction based on the given id pattern", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_03 Query several entities via POST Interaction based on the given id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", + "doc": "Check that you can query several entities via POST Interaction based on the given id pattern", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_id_pattern set to 'urn:ngsi-ld:Building:.*' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_02_04.json b/doc/files/ContextInformation/Consumption/019_02_04.json new file mode 100644 index 0000000000000000000000000000000000000000..12cfe6e815b8d1e2c6b421511e18732d24e7ab1c --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_04", + "test_objective": "Check that you can query several entities via POST Interaction based on attribute names", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_04 Query several entities via POST Interaction based on attribute names", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_04", + "doc": "Check that you can query several entities via POST Interaction based on attribute names", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_retrieved' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_02_05.json b/doc/files/ContextInformation/Consumption/019_02_05.json new file mode 100644 index 0000000000000000000000000000000000000000..86ed504906fbd1e2af33b60a0c6199dbae5bd47b --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_05.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_05", + "test_objective": "Check that you can query entitites via POST Interaction asking for a GeoJSON representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_05 Query several entities via POST Interaction asking for a GeoJSON representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_05", + "doc": "Check that you can query entities via POST Interaction asking for a GeoJSON representation", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_03_01.json b/doc/files/ContextInformation/Consumption/019_03_01.json new file mode 100644 index 0000000000000000000000000000000000000000..f84c9729175c0b2bdeccc74f57c12e4018d26933 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", + "test_objective": "Check that you cannot query entities if the requested ids are incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_03_01 Query entities based on incorrect ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", + "doc": "Check that you cannot query entities if the requested ids are incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 400 and\n Query Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_03_02.json b/doc/files/ContextInformation/Consumption/019_03_02.json new file mode 100644 index 0000000000000000000000000000000000000000..0488daaeab68ad332a6f9347e8012bfd9cc4d2cc --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", + "test_objective": "Check that you cannot query entities if the requested entity types are incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_03_02 Query entities based on incorrect entity types", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", + "doc": "Check that you cannot query entities if the requested entity types are incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 400 and\n Query Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_03_03.json b/doc/files/ContextInformation/Consumption/019_03_03.json new file mode 100644 index 0000000000000000000000000000000000000000..f0b3d43e666f8f72380572054165e5675427bee5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", + "test_objective": "Check that you cannot query entities if the requested id pattern is incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_03_03 Query several entities based on incorrect id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", + "doc": "Check that you cannot query entities if the requested id pattern is incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 400 and\n Query Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_id_pattern set to 'invalid_entity_id_pattern**' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_03_04.json b/doc/files/ContextInformation/Consumption/019_03_04.json new file mode 100644 index 0000000000000000000000000000000000000000..f6e9832d87ad0f76f8926dd63f47c32273370713 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_04", + "test_objective": "Check that you cannot query entities if the requested attribute names are incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_03_04 Query several entities based on incorrect attribute names", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_04", + "doc": "Check that you cannot query entities if the requested attribute names are incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 400 and\n Query Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_03_05.json b/doc/files/ContextInformation/Consumption/019_03_05.json new file mode 100644 index 0000000000000000000000000000000000000000..1226b9740ea21456e4f5219bd9a9f6303120ab09 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_05.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_05", + "test_objective": "Check that you cannot query entities if the request has a wrong geometryProperty", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_03_05 Query entities when the request has a wrong geometryProperty", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_05", + "doc": "Check that you cannot query entities if the request has a wrong geometryProperty", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 400 and\n Query Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: geoproperty set to 'location' and\n Query Parameter: georel set to 'invalid' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[-8.503,41.202]' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_04.json b/doc/files/ContextInformation/Consumption/019_04.json new file mode 100644 index 0000000000000000000000000000000000000000..b28b578f6391dda5a1333dfa42bf273fccf70128 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_04", + "test_objective": "Check that the queried entities by Id can be returned in a simplified representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_04_01 Query entities in a simplified representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_04_01", + "doc": "Check that the queried entities by Id can be returned in a simplified representation", + "tags": [ + "6_3_7", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'keyValues'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_05.json b/doc/files/ContextInformation/Consumption/019_05.json new file mode 100644 index 0000000000000000000000000000000000000000..23e8aecd482003202c2fa109bd2d4609d6da6408 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_05.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_05", + "test_objective": "Check that the queried entities by id can be returned in GeoJSON format", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [ + "Create Initial Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_05_01 Get an entity by id that can be returned in GeoJSON format", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_05_01", + "doc": "Check that the queried entities by id can be returned in GeoJSON format", + "tags": [ + "6_3_7", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_06.json b/doc/files/ContextInformation/Consumption/019_06.json new file mode 100644 index 0000000000000000000000000000000000000000..d0fb4d10526bc8bf3c44bbce4701a6962709c9f0 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_06.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_06", + "test_objective": "Check that you can query entities specifying a maximum number of results", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_10", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_06_01 Query entities specifying a maximum number of results", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_06_01", + "doc": "Check that you can query entities specifying a maximum number of results", + "tags": [ + "6_3_10", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list of entities equal to '${2}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: limit set to '2'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_01.json b/doc/files/ContextInformation/Consumption/020_01.json new file mode 100644 index 0000000000000000000000000000000000000000..e8d3b450c4892d6f986c5527b0d8495603ae19f7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_01", + "test_objective": "Check that you can retrieve the temporal evolution of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_01_01 Retrieve the temporal evolution of an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_01_01", + "doc": "Check that you can retrieve the temporal evolution of an entity", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-01-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_02.json b/doc/files/ContextInformation/Consumption/020_02.json new file mode 100644 index 0000000000000000000000000000000000000000..ff467a7db7564dcc7c31191f804bb29012b5cd8e --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_02", + "test_objective": "Check that you can retrieve the temporal evolution of an entity using a context", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_02_01 Retrieve the temporal evolution of an entity using a context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_02_01", + "doc": "Check that you can retrieve the temporal evolution of an entity using a context", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-02-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_03.json b/doc/files/ContextInformation/Consumption/020_03.json new file mode 100644 index 0000000000000000000000000000000000000000..ed4f98dc29b3922be4d4487c2d1614bd8b9cdd9e --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_03", + "test_objective": "Check that you can retrieve the temporal evolution of certain attributes of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "020_03_01 Retrieve the temporal evolution of certain attributes of an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_03_01", + "doc": "Check that you can retrieve the temporal evolution of certain attributes of an entity", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-03-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to '${temporal_attributes_to_be_retrieved}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_04.json b/doc/files/ContextInformation/Consumption/020_04.json new file mode 100644 index 0000000000000000000000000000000000000000..8bf0283e56cebc677911a059d4d77487cfe4b191 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_04.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_04", + "test_objective": "Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "020_04_01 After", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_04_01", + "doc": "Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-04-01-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-08-01T13:03:00Z' and\n Query Parameter: endTimeAt set to '${EMPTY}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_04_02 Before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_04_02", + "doc": "Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-04-02-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2020-08-01T12:05:00Z' and\n Query Parameter: endTimeAt set to '${EMPTY}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_04_03 Between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_04_03", + "doc": "Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-04-03-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'between' and\n Query Parameter: timeAt set to '2020-08-01T12:00:00Z' and\n Query Parameter: endTimeAt set to '2020-08-01T13:00:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_05.json b/doc/files/ContextInformation/Consumption/020_05.json new file mode 100644 index 0000000000000000000000000000000000000000..1c9c860103efb79e9c7600de2599fa624c1fa61d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_05.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05", + "test_objective": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "020_05_01 Retrieve Some Instances", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05_01", + "doc": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of the last N instances of entity attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-05-01-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: lastN set to '10' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_05_02 Retrieve All Instances", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05_02", + "doc": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of the last N instances of entity attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-05-02-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: lastN set to '20' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_06.json b/doc/files/ContextInformation/Consumption/020_06.json new file mode 100644 index 0000000000000000000000000000000000000000..dbb7f7f229bcf8c3d631c7d069c1adf30ebc4546 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_06.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_06", + "test_objective": "Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI)", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_06_01 Retrieve the temporal evolution of an entity with an invalid id", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_06_01", + "doc": "Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI)", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 400 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to 'invalidUri'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_07.json b/doc/files/ContextInformation/Consumption/020_07.json new file mode 100644 index 0000000000000000000000000000000000000000..3876700d593822499161b57fcd6eac78cdc5f3b1 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_07.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_07", + "test_objective": "Check that you cannot retrieve the temporal evolution of a non-existing entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_07_01 Retrieve the temporal evolution of a non-existing entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_07_01", + "doc": "Check that you cannot retrieve the temporal evolution of a non-existing entity", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 404 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to 'urn:ngsi-ld:Vehicle:unknowEntity'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_08.json b/doc/files/ContextInformation/Consumption/020_08.json new file mode 100644 index 0000000000000000000000000000000000000000..07f91dbe25f81ce00e2b3a4b0a1bd15b1e08c005 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_08.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_08", + "test_objective": "Check that you cannot retrieve the temporal evolution of non-existing entity attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_08_01 Retrieve the temporal evolution of non-existing entity attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_08_01", + "doc": "Check that you cannot retrieve the temporal evolution of non-existing entity attributes", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 404 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to '${temporal_attributes_to_be_retrieved}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_09.json b/doc/files/ContextInformation/Consumption/020_09.json new file mode 100644 index 0000000000000000000000000000000000000000..aa5e23559361494ac1a6ff56a8f8e01e745ec484 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_09.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_09", + "test_objective": "Check that you cannot retrieve the temporal evolution of an entity with an invalid request content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "020_09_01 After", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_09_01", + "doc": "Check that you cannot retrieve the temporal evolution of an entity with an invalid request content", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity with an invalid request content", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 400 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '${EMPTY}' and\n Query Parameter: endTimeAt set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_09_02 Before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_09_02", + "doc": "Check that you cannot retrieve the temporal evolution of an entity with an invalid request content", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity with an invalid request content", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 400 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '${EMPTY}' and\n Query Parameter: endTimeAt set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_09_03 Between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_09_03", + "doc": "Check that you cannot retrieve the temporal evolution of an entity with an invalid request content", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Initial Temporal Entity", + "template": "Retrieve the temporal evolution of an entity with an invalid request content", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 400 and\n Retrieve Temporal Representation Of Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Temporal Representation Of Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: timerel set to 'between' and\n Query Parameter: timeAt set to '2020-08-01T12:00:00Z' and\n Query Parameter: endTimeAt set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_10.json b/doc/files/ContextInformation/Consumption/020_10.json new file mode 100644 index 0000000000000000000000000000000000000000..4d8952ff1bce0106fc7d0116dd82fd6db1bb4c4d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_10.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_10", + "test_objective": "Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_3", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_10_01 Retrieve the temporal evolution of an entity with the simplified temporal representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_10_01", + "doc": "Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation", + "tags": [ + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-10-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: options set to '${options}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_01.json b/doc/files/ContextInformation/Consumption/021_01.json new file mode 100644 index 0000000000000000000000000000000000000000..c05c554764a030caf0745101f69b4dede87abacb --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_01", + "test_objective": "Check that you can query the temporal evolution of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "021_01_01 After", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_01_01", + "doc": "Check that you can query the temporal evolution of entities", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Query the temporal evolution of entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-01-01-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-08-01T12:04:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_01_02 Before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_01_02", + "doc": "Check that you can query the temporal evolution of entities", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Query the temporal evolution of entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-01-02-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2020-09-01T13:06:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_02.json b/doc/files/ContextInformation/Consumption/021_02.json new file mode 100644 index 0000000000000000000000000000000000000000..ab692711333c86c2f1f921f3fe98157c0c06cde6 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02", + "test_objective": "Check that you can query the temporal evolution of certain attributes of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_02_01 Query the temporal evolution of certain attributes of entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02_01", + "doc": "Check that you can query the temporal evolution of certain attributes of entities", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-02-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: attrs set to '${temporal_attributes_to_be_retrieved}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_03.json b/doc/files/ContextInformation/Consumption/021_03.json new file mode 100644 index 0000000000000000000000000000000000000000..e66dcf915b700e8b2799fd03bc18a0ec1ab48350 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_03", + "test_objective": "Check that you can query the temporal evolution of the last N instances of entities attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_03_01 Query the temporal evolution of the last N instances of entities attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_03_01", + "doc": "Check that you can query the temporal evolution of the last N instances of entities attributes", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-03-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: lastN set to '14' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_04.json b/doc/files/ContextInformation/Consumption/021_04.json new file mode 100644 index 0000000000000000000000000000000000000000..5e27dc38864ff224cb94f6a661fb3aa473a8712a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_04", + "test_objective": "Check that you can query the temporal evolution of entities using a context", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_04_01 Query the temporal evolution of entities using a context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_04_01", + "doc": "Check that you can query the temporal evolution of entities using a context", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-04-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_05.json b/doc/files/ContextInformation/Consumption/021_05.json new file mode 100644 index 0000000000000000000000000000000000000000..e65e70e114915472e50e7bc250f9b3546c31647a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_05.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_05", + "test_objective": "Check that you can query the temporal evolution of entities matching the given type(s)", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_05_01 Query the temporal evolution of entities matching the given type(s)", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_05_01", + "doc": "Check that you can query the temporal evolution of entities matching the given type(s)", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-05-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_06.json b/doc/files/ContextInformation/Consumption/021_06.json new file mode 100644 index 0000000000000000000000000000000000000000..e92ef59f2ac2e6fd56a63745dcf9cc07e5803854 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_06.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_06", + "test_objective": "Check that you can query the temporal evolution of entities matching the given identifier(s)", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_06_01 Query the temporal evolution of entities matching the given identifier(s)", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_06_01", + "doc": "Check that you can query the temporal evolution of entities matching the given identifier(s)", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-06-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: entity_ids set to '${entity_ids_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_07.json b/doc/files/ContextInformation/Consumption/021_07.json new file mode 100644 index 0000000000000000000000000000000000000000..a5ee2b2adfa120629b36bb8d767b7c010012554a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_07.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_07", + "test_objective": "Check that you can query the temporal evolution of entities matching the given id pattern", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_07_01 Query the temporal evolution of entities matching the given id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_07_01", + "doc": "Check that you can query the temporal evolution of entities matching the given id pattern", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-07-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: entity_id_pattern set to 'urn:ngsi-ld:Vehicle:.*' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_08.json b/doc/files/ContextInformation/Consumption/021_08.json new file mode 100644 index 0000000000000000000000000000000000000000..f75589a4a33112e11326c711e030a5656f226efe --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_08.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_08", + "test_objective": "Check that you can query the temporal evolution of entities matching the given NGSI-LD query", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "teardown": "Delete Initial Temporal Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_08_01 Query the temporal evolution of entities matching the given NGSI-LD query", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_08_01", + "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD query", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-08-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: ngsild_query set to 'speed>90' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_09.json b/doc/files/ContextInformation/Consumption/021_09.json new file mode 100644 index 0000000000000000000000000000000000000000..15397ff105bf6b1b42a426446b00a6b0d8e1e3a2 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_09.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09", + "test_objective": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an a list of Temporal Entities \n}", + "test_cases": [ + { + "name": "021_09_01 Near Point", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09_01", + "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities matching the given NGSI-LD geo-query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-09-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: georel set to 'near;maxDistance==2000' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[-8.503,41.202]' and\n Query Parameter: geoproperty set to '${EMPTY}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_09_02 Within Polygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09_02", + "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities matching the given NGSI-LD geo-query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-09-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]]' and\n Query Parameter: geoproperty set to 'location' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_10.json b/doc/files/ContextInformation/Consumption/021_10.json new file mode 100644 index 0000000000000000000000000000000000000000..922a1c3898ed66e11aa41f966ac8cc26fc77eec7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_10.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_10", + "test_objective": "Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Context Source Registration of a context source (CS1) \n providing temporal information of two entities of type Building between 2020-08-01T22:07:00Z and 2021-08-01T21:07:00Z\n and CS1 containing two temporal entities of type Building and temporal evolution of those entities in the mentioned interval.\n}", + "test_cases": [ + { + "name": "021_10_01 Query the temporal evolution of entities matching the given NGSI-LD context source filter", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_10_01", + "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Create Initial Context Source Registration and Mock Server", + "teardown": "Delete Initial Context Source Registration and Mock Server", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Query Temporal Representation Of Entities with Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: csf set to 'endpoint' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_11.json b/doc/files/ContextInformation/Consumption/021_11.json new file mode 100644 index 0000000000000000000000000000000000000000..b13757a819cef6929ddb04ebe26f16c6fd484ecf --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_11.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_11", + "test_objective": "Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an a list of Temporal Entities \n}", + "test_cases": [ + { + "name": "021_11_01 Query Some entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_11_01", + "doc": "Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Response Body containing a list of entities equal to '${2}' of type 'Vehicle' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: limit set to '${2}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_11_02 Query All entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_11_02", + "doc": "Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Response Body containing a list of entities equal to '${3}' of type 'Vehicle' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: limit set to '${3}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_11" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_12.json b/doc/files/ContextInformation/Consumption/021_12.json new file mode 100644 index 0000000000000000000000000000000000000000..0b6da838a6482e416b80221527c34cbf104106c7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_12.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_12", + "test_objective": "Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_12_01 Query the temporal evolution of entities with an invalid request", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_12_01", + "doc": "Check that you cannot query the temporal evolution of entities with an invalid request", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 400 and\n Query Temporal Representation Of Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Temporal Representation Of Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_12" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_13.json b/doc/files/ContextInformation/Consumption/021_13.json new file mode 100644 index 0000000000000000000000000000000000000000..9123eb1440ec289c55c9ae9ef6042a52142672e0 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_13.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13", + "test_objective": "Check that you can query the temporal evolution of entities using the entityOperations method", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an a list of Temporal Entities \n}", + "test_cases": [ + { + "name": "021_13_01 After", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_01", + "doc": "Check that you can query the temporal evolution of entities using the entityOperations method", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities using the entityOperations method", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-01-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entityOperations/query" + }, + { + "name": "021_13_02 Before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_02", + "doc": "Check that you can query the temporal evolution of entities using the entityOperations method", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities using the entityOperations method", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-02-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-before-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entityOperations/query" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_13" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/022_01.json b/doc/files/ContextInformation/Consumption/022_01.json new file mode 100644 index 0000000000000000000000000000000000000000..62cde4316877206d0d9593248643b56ad1621dcd --- /dev/null +++ b/doc/files/ContextInformation/Consumption/022_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/022_01", + "test_objective": "Check that you can retrieve a list of NGSI-LD entity types", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "022_01_01 WithoutJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/022_01_01", + "doc": "Check that you can retrieve a list of NGSI-LD entity types", + "tags": [ + "5_7_5", + "ed-types" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Retrieve Available Entity Types", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Types with Response Status Code set to 200 and\n Retrieve Entity Types with Response Body containing an Entity Type List with expectation body equal to file: 'types/expectations/entity-type-list-022-01-01-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types'\n method set to 'GET'\n Retrieve entity types: and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "types" + }, + { + "name": "022_01_02 WithJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/022_01_02", + "doc": "Check that you can retrieve a list of NGSI-LD entity types", + "tags": [ + "5_7_5", + "ed-types" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Retrieve Available Entity Types", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Types with Response Status Code set to 200 and\n Retrieve Entity Types with Response Body containing an Entity Type List with expectation body equal to file: 'types/expectations/entity-type-list-022-01-02-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types'\n method set to 'GET'\n Retrieve entity types: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "types" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes", + "robotfile": "022_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/023_01.json b/doc/files/ContextInformation/Consumption/023_01.json new file mode 100644 index 0000000000000000000000000000000000000000..80cca411c503b413265fdd583e88ee949a70b7fa --- /dev/null +++ b/doc/files/ContextInformation/Consumption/023_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/023_01", + "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD entity types", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "023_01_01 WithoutJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/023_01_01", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD entity types", + "tags": [ + "5_7_6", + "ed-types-details" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Retrieve Details Of Available Entity Types", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Types with Response Status Code set to 200 and\n Retrieve Entity Types with Response Body containing an Entity Type Element with expectation body equal to file: 'types/expectations/entity-type-023-01-01-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types'\n method set to 'GET'\n Retrieve entity types: and\n Query Parameter: context set to '${EMPTY}' and\n Query Parameter: details set to 'true'\n}", + "http_verb": "GET", + "endpoint": "types" + }, + { + "name": "023_01_02 WithJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/023_01_02", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD entity types", + "tags": [ + "5_7_6", + "ed-types-details" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Retrieve Details Of Available Entity Types", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Types with Response Status Code set to 200 and\n Retrieve Entity Types with Response Body containing an Entity Type Element with expectation body equal to file: 'types/expectations/entity-type-023-01-02-expectation.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types'\n method set to 'GET'\n Retrieve entity types: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: details set to 'true'\n}", + "http_verb": "GET", + "endpoint": "types" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes", + "robotfile": "023_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/024_01.json b/doc/files/ContextInformation/Consumption/024_01.json new file mode 100644 index 0000000000000000000000000000000000000000..780dd6ecfad5c5ff156fc062fb5bf151b6c98b75 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/024_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01", + "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_7", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "024_01_01 Retrieve Detailed Representation Of Available Entity Type Without Context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01_01", + "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", + "tags": [ + "5_7_7", + "ed-type" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Type with Response Status Code set to 404 and\n Retrieve Entity Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Entity Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building'\n}", + "http_verb": "GET", + "endpoint": "types/{type}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", + "robotfile": "024_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/024_02.json b/doc/files/ContextInformation/Consumption/024_02.json new file mode 100644 index 0000000000000000000000000000000000000000..dae2e2069e2fd1abe530cbcca187764c77307b3d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/024_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02", + "test_objective": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_7", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "024_02_01 Retrieve Detailed Representation Of Available Entity Type", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_01", + "doc": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "tags": [ + "5_7_7", + "ed-type" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Type with Response Status Code set to 200 and\n Retrieve Entity Type with Response body containing an Entity Type Info with expectation body set to file 'types/expectations/entity-type-info-024-01-expectation.json' and response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "types/{type}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", + "robotfile": "024_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/025_01.json b/doc/files/ContextInformation/Consumption/025_01.json new file mode 100644 index 0000000000000000000000000000000000000000..825e469e06a60c35c4b508aa243e96a31ce44be8 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/025_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/025_01", + "test_objective": "Check that you can retrieve a list of NGSI-LD attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "025_01_01 WithoutJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/025_01_01", + "doc": "Check that you can retrieve a list of NGSI-LD attributes", + "tags": [ + "5_7_8", + "ed-attrs" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Retrieve Available Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attributes with Response Status Code set to 200 and\n Retrieve Attributes with Response Body containing an Attribute List element\n * with filename set to 'types/expectations/attribute-list-025-01-01-expectation.json'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes'\n method set to 'GET'\n Retrieve attributes: and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "attributes" + }, + { + "name": "025_01_02 WithJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/025_01_02", + "doc": "Check that you can retrieve a list of NGSI-LD attributes", + "tags": [ + "5_7_8", + "ed-attrs" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Retrieve Available Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attributes with Response Status Code set to 200 and\n Retrieve Attributes with Response Body containing an Attribute List element\n * with filename set to 'types/expectations/attribute-list-025-01-02-expectation.json'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes'\n method set to 'GET'\n Retrieve attributes: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "attributes" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes", + "robotfile": "025_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/026_01.json b/doc/files/ContextInformation/Consumption/026_01.json new file mode 100644 index 0000000000000000000000000000000000000000..d94cc0c308a06509aefc22eb875931bdc2ac8c65 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/026_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/026_01", + "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.9", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_9", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "026_01_01 WithoutJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/026_01_01", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "tags": [ + "5_7_9", + "ed-attrs-details" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Retrieve Details Of Available Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attributes with Response Status Code set to 200 and\n Retrieve Attributes with Response body containing an array of attributes\n * with the expected payload defined in the file 'types/expectations/attribute-026-01-01-expectation.json'\n * and response body set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes'\n method set to 'GET'\n Retrieve attributes: and\n Query Parameter: context set to '${EMPTY}' and\n Query Parameter: details set to 'true'\n}", + "http_verb": "GET", + "endpoint": "attributes" + }, + { + "name": "026_01_02 WithJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/026_01_02", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "tags": [ + "5_7_9", + "ed-attrs-details" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Retrieve Details Of Available Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attributes with Response Status Code set to 200 and\n Retrieve Attributes with Response body containing an array of attributes\n * with the expected payload defined in the file 'types/expectations/attribute-026-01-02-expectation.json'\n * and response body set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes'\n method set to 'GET'\n Retrieve attributes: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: details set to 'true'\n}", + "http_verb": "GET", + "endpoint": "attributes" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes", + "robotfile": "026_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/027_01.json b/doc/files/ContextInformation/Consumption/027_01.json new file mode 100644 index 0000000000000000000000000000000000000000..a1730ef0956f2be5ca4a5b1a787541a80d3b2d54 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/027_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01", + "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_10", + "keywords": [ + "Setup Initial Entity", + "Delete Initial Entity" + ], + "teardown": "Delete Initial Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "027_01_01 Retrieve Detailed Representation Of Available Attribute Without Context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01_01", + "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", + "tags": [ + "5_7_10", + "ed-attr" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attribute with Response Status Code set to 404 and\n Retrieve Attribute with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Attribute with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'\n}", + "http_verb": "GET", + "endpoint": "attributes/{attribute_name}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", + "robotfile": "027_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/027_02.json b/doc/files/ContextInformation/Consumption/027_02.json new file mode 100644 index 0000000000000000000000000000000000000000..fda5720c994acc113ec126bb49f1393cf265aa10 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/027_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02", + "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_10", + "keywords": [ + "Setup Initial Entity", + "Delete Initial Entity" + ], + "teardown": "Delete Initial Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "027_02_01 Retrieve Detailed Representation Of Available Attribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_01", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "tags": [ + "5_7_10", + "ed-attr" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attribute with Response Status Code set to 200 and\n Retrieve Attribute with Response body containing an array of attributes\n * with the expected payload defined in the file 'types/expectations/attribute-027-01-expectation.json'\n * and response body set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'\n}", + "http_verb": "GET", + "endpoint": "attributes/{attribute_name}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", + "robotfile": "027_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_01.json b/doc/files/ContextInformation/Provision/001_01.json new file mode 100644 index 0000000000000000000000000000000000000000..3abb22a970d79606d3dbe89aa6666e83fe42c51c --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_01.json @@ -0,0 +1,82 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_01", + "test_objective": "Check that you can create an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_01_01 MinimalEntity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_01", + "doc": "Check that you can create an entity", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-minimal-without-context-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_01_02 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_02", + "doc": "Check that you can create an entity", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_01_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_03", + "doc": "Check that you can create an entity", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-relationship-of-property-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_01_04 EntityWithLocationAttribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_04", + "doc": "Check that you can create an entity", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-location-attribute-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_02.json b/doc/files/ContextInformation/Provision/001_02.json new file mode 100644 index 0000000000000000000000000000000000000000..cc166c74d655c772ed4fbecb19c66494c880a678 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_02.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_02", + "test_objective": "Check that you cannot create an entity with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_02_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_02_01", + "doc": "Check that you cannot create an entity with an invalid request", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": null, + "template": "Create Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity From File with Response Status Code set to 400 and\n Create Entity From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Create Entity From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request creation of an entity from filename 'invalid-json-sample.jsonld' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_02_02 EmptyJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_02_02", + "doc": "Check that you cannot create an entity with an invalid request", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": null, + "template": "Create Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity From File with Response Status Code set to 400 and\n Create Entity From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Create Entity From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request creation of an entity from filename 'empty-sample.jsonld' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_02_03 EntityWithNoContext", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_02_03", + "doc": "Check that you cannot create an entity with an invalid request", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": null, + "template": "Create Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity From File with Response Status Code set to 400 and\n Create Entity From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Entity From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request creation of an entity from filename 'building-minimal-without-context-sample.jsonld' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_03.json b/doc/files/ContextInformation/Provision/001_03.json new file mode 100644 index 0000000000000000000000000000000000000000..6f5242cdc403c84868353b36e390afea2ef51f9a --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_03", + "test_objective": "Check that you cannot create an entity with an existing id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_1", + "keywords": [ + "Delete Initial Entity" + ], + "teardown": "Delete Initial Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_03_01 Create one valid entity and one invalid entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_03_01", + "doc": "Check that you cannot create an entity with an existing id", + "tags": [ + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 409 and\n Create Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists' and\n Create Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-minimal-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_04.json b/doc/files/ContextInformation/Provision/001_04.json new file mode 100644 index 0000000000000000000000000000000000000000..5b664193b79b0d4e7e5c5da16fe77802ed7bd13e --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_04.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_04", + "test_objective": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_04_01 Create one entity using a provided Link header with JSON content type and NGSILD context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_04_01", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-simple-attributes-sample.json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_04_02 Create one entity using a provided Link header with JSON content type and no context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_04_02", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'https://ngsi-ld-test-suite/context#almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-simple-attributes-sample.json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_05.json b/doc/files/ContextInformation/Provision/001_05.json new file mode 100644 index 0000000000000000000000000000000000000000..256221ec99411dcd44e8f5c47b90a389a584e22d --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_05.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_05", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_05_01 Create one entity using the default context with JSON content type and request without context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_05_01", + "doc": "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, requesting without context", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-simple-attributes-sample.json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_05_02 Create one entity using the default context with JSON content type and request with context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_05_02", + "doc": "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, requesting with context", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'ngsi-ld:default-context/almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-simple-attributes-sample.json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_06.json b/doc/files/ContextInformation/Provision/001_06.json new file mode 100644 index 0000000000000000000000000000000000000000..c61e04b744e7e2dc573e118ab4115507faba530b --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_06.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_06", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_06_01 Create one entity containing a JSON-LD @context with a JSON content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_06_01", + "doc": "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": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 400 and\n Create Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_07.json b/doc/files/ContextInformation/Provision/001_07.json new file mode 100644 index 0000000000000000000000000000000000000000..96278f09dccab34d2b6ee7e8f237850c0a73f9ff --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_07.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_07", + "test_objective": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_07_01 Create one entity using a JSON-LD @context obtained from the request payload with ld context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_07_01", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and retrieve with ld context", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_07_02 Create one entity using a JSON-LD @context obtained from the request payload without context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_07_02", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and retrieve without context", + "tags": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'https://ngsi-ld-test-suite/context#almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_08.json b/doc/files/ContextInformation/Provision/001_08.json new file mode 100644 index 0000000000000000000000000000000000000000..16cba75fdb7da819335dd3389b34c1e06c623a1d --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_08.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_08_01 Create one entity not containing a JSON-LD @context with a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_08_01", + "doc": "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": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 400 and\n Create Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.json'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_09.json b/doc/files/ContextInformation/Provision/001_09.json new file mode 100644 index 0000000000000000000000000000000000000000..e7c9ac02e0c720756e245fab3ced90249cb95c81 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_09.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_09", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_09_01 Create one entity with a Link header and a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_09_01", + "doc": "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": [ + "6_3_5", + "e-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 400 and\n Create Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/002_01.json b/doc/files/ContextInformation/Provision/002_01.json new file mode 100644 index 0000000000000000000000000000000000000000..d84ec1cc6d2776fa99318af055fe0806ab803039 --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/002_01", + "test_objective": "Check that you can delete an entity by id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "002_01_01 Delete an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/002_01_01", + "doc": "Check that you can delete an entity by id", + "tags": [ + "5_6_6", + "e-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity by Id with Response Status Code set to 204 and\n Retrieve Entity by Id with Response Status Code set to ${response2.status_code}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/DeleteEntity", + "robotfile": "002_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/002_02.json b/doc/files/ContextInformation/Provision/002_02.json new file mode 100644 index 0000000000000000000000000000000000000000..b09439d2ad015dc717ba709b0af1c0fb66f576dc --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_02.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/002_02", + "test_objective": "Check that you cannot delete an entity with invalid/missing id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "002_02_01 Delete an entity if the Entity Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/002_02_01", + "doc": "Check that you cannot delete an entity with invalid/missing id", + "tags": [ + "5_6_6", + "e-delete" + ], + "setup": null, + "teardown": null, + "template": "Delete Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity by Id with Response Status Code set to 405 and\n Delete Entity by Id with Response Body containing the type '${EMPTY}' and\n Delete Entity by Id with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'DELETE'\n Delete Entity Request with id set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{id}" + }, + { + "name": "002_02_02 Delete an entity if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/002_02_02", + "doc": "Check that you cannot delete an entity with invalid/missing id", + "tags": [ + "5_6_6", + "e-delete" + ], + "setup": null, + "teardown": null, + "template": "Delete Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity by Id with Response Status Code set to 400 and\n Delete Entity by Id with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Entity by Id with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'DELETE'\n Delete Entity Request with id set to 'thisisaninvaliduri'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Provision/Entities/DeleteEntity", + "robotfile": "002_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/002_03.json b/doc/files/ContextInformation/Provision/002_03.json new file mode 100644 index 0000000000000000000000000000000000000000..7d8c500712b9c9bf42921918c4bf906a38f06960 --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/002_03", + "test_objective": "Check that you cannot delete an entity if the entity id is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "002_03_01 Delete an entity with an id not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/002_03_01", + "doc": "Check that you cannot delete an entity if the entity id is not known to the system", + "tags": [ + "5_6_6", + "e-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity by Id with Response Status Code set to 404 and\n Delete Entity by Id with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Entity by Id with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'DELETE'\n Delete Entity Request with id set to '${entity_id}'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/DeleteEntity", + "robotfile": "002_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_01.json b/doc/files/ContextInformation/Provision/003_01.json new file mode 100644 index 0000000000000000000000000000000000000000..62bfec3531a57376645075aac07fb15bc73dac24 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_01.json @@ -0,0 +1,80 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_01", + "test_objective": "Check that you can create a batch of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_01_01 MinimalEntity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_01_01", + "doc": "Check that you can create a batch of entities", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Batch Create Entities with Response Body set to an array of created entities ids and\n Query Entities with Check Created Resource Set To and\n Query Parameter: 'expected_resources' set to 'entities_to_be_created' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to '' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_01_02 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_01_02", + "doc": "Check that you can create a batch of entities", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Batch Create Entities with Response Body set to an array of created entities ids and\n Query Entities with Check Created Resource Set To and\n Query Parameter: 'expected_resources' set to 'entities_to_be_created' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to '' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_01_03 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_01_03", + "doc": "Check that you can create a batch of entities", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Batch Create Entities with Response Body set to an array of created entities ids and\n Query Entities with Check Created Resource Set To and\n Query Parameter: 'expected_resources' set to 'entities_to_be_created' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to '' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_01_04 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_01_04", + "doc": "Check that you can create a batch of entities", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Create Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Batch Create Entities with Response Body set to an array of created entities ids and\n Query Entities with Check Created Resource Set To and\n Query Parameter: 'expected_resources' set to 'entities_to_be_created' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to '' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_02.json b/doc/files/ContextInformation/Provision/003_02.json new file mode 100644 index 0000000000000000000000000000000000000000..b901ac9207c374819eacb84e7f9b884a45de025c --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_02", + "test_objective": "Check that you can create a batch of entities where some will succeed and others will fail", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_7", + "keywords": [ + "Setup Initial Entity", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_02_01 Create a batch of two valid entities and one invalid entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_02_01", + "doc": "Check that you can create a batch of two valid entities and one invalid entity", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 207 and\n Batch Create Entities with Response body containing batch operation result set to '${expected_batch_operation_result}' and\n Query Entities with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to '' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_03.json b/doc/files/ContextInformation/Provision/003_03.json new file mode 100644 index 0000000000000000000000000000000000000000..575bc743e63be2694f07f8bcfeb342d58c1db644 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_03.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_03", + "test_objective": "Check that you cannot create a batch of entities with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_03_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_03_01", + "doc": "Check that you cannot create a batch of entities with an invalid request", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": null, + "template": "Create Batch Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'create', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_03_01 EmptyJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_03_01", + "doc": "Check that you cannot create a batch of entities with an invalid request", + "tags": [ + "5_6_7", + "be-create" + ], + "setup": null, + "teardown": null, + "template": "Create Batch Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'create', Content-Type set to 'application/ld+json', and body set to 'batch/empty-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_04.json b/doc/files/ContextInformation/Provision/003_04.json new file mode 100644 index 0000000000000000000000000000000000000000..6a1062a953271cda8638a60871b9a07a87b10a67 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_04.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_04", + "test_objective": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_04_01 Create a batch of one entity using a provided Link header with JSON content type and retrieve the entity with context detail", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_04_01", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_04_02 Create a batch of one entity using a provided Link header with JSON content type and retrieve the entity without context detail", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_04_02", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'https://ngsi-ld-test-suite/context#almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_05.json b/doc/files/ContextInformation/Provision/003_05.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe38f61e54e55b4e9b280640821e846b38731ed --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_05.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_05", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_05_01 Create a batch of one entity using the default context with JSON content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_05_01", + "doc": "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 and retrieve the entity without context", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_05_02 Create a batch of one entity using the default context with JSON content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_05_02", + "doc": "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 and retrieve the entity with context", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'ngsi-ld:default-context/almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_06.json b/doc/files/ContextInformation/Provision/003_06.json new file mode 100644 index 0000000000000000000000000000000000000000..955c38eba225c5697ecfc4d5c9e0c7b4c33e8987 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_06.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_06", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_06_01 Create a batch of one entity containing a JSON-LD @context with a JSON content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_06_01", + "doc": "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": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 400 and\n Batch Create Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Create Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_07.json b/doc/files/ContextInformation/Provision/003_07.json new file mode 100644 index 0000000000000000000000000000000000000000..71e53ac46a745d0af0669577cbf6c6d06e2c511c --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_07.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_07", + "test_objective": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_07_01 Create a batch of one entity using a JSON-LD @context obtained from the request payload", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_07_01", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and the response attribute should be compacted as we used the same context as provided when creating the entity", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "003_07_02 Create a batch of one entity using a JSON-LD @context obtained from the request payload", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_07_02", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and response attribute should not be compacted as we did not provide a context containing this term", + "tags": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 201 and\n Retrieve Entity by Id with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'https://ngsi-ld-test-suite/context#almostFull' and\n Query Parameter: response_body set to 'response1.json()'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_08.json b/doc/files/ContextInformation/Provision/003_08.json new file mode 100644 index 0000000000000000000000000000000000000000..fc35919ca8b8f3823111c3ca506bcaaf92606a23 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_08.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_08_01 Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_08_01", + "doc": "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": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 400 and\n Batch Create Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Create Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/003_09.json b/doc/files/ContextInformation/Provision/003_09.json new file mode 100644 index 0000000000000000000000000000000000000000..dab43588b43bda95579476a445dd95a55f1fdba9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_09.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/003_09", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "003_09_01 Create a batch of one entity with a Link header and a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_09_01", + "doc": "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": [ + "6_3_5", + "be-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Create Entities with Response Status Code set to 400 and\n Batch Create Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Create Entities with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created\n}", + "http_verb": "POST", + "endpoint": "entityOperations/create" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/CreateBatchOfEntities", + "robotfile": "003_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_01.json b/doc/files/ContextInformation/Provision/004_01.json new file mode 100644 index 0000000000000000000000000000000000000000..ad9eaa23d54900d7b52232900be9c4ddeb20a422 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_01.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_01", + "test_objective": "Check that you can upsert a batch of non-existing entities and they will be created", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "004_01_01 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_01_01", + "doc": "Check that you can upsert a batch of non-existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_01_02 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_01_02", + "doc": "Check that you can upsert a batch of non-existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_01_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_01_03", + "doc": "Check that you can upsert a batch of non-existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_02.json b/doc/files/ContextInformation/Provision/004_02.json new file mode 100644 index 0000000000000000000000000000000000000000..545c64847978c9ed48f7fb62be2316c7d31f42ff --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_02.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_02", + "test_objective": "Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "004_02_01 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_02_01", + "doc": "Check that you can upsert a batch of non-existing and existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Non-existing And Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_02_02 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_02_02", + "doc": "Check that you can upsert a batch of non-existing and existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Non-existing And Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_02_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_02_03", + "doc": "Check that you can upsert a batch of non-existing and existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Non-existing And Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_03.json b/doc/files/ContextInformation/Provision/004_03.json new file mode 100644 index 0000000000000000000000000000000000000000..c3b2ba6a26e24a1461c2128f8dce5bd165525d29 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_03.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_03", + "test_objective": "Check that you can upsert a batch of existing entities and they will be replaced", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "004_03_01 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_03_01", + "doc": "Check that you can upsert a batch of existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_03_02 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_03_02", + "doc": "Check that you can upsert a batch of existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_03_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_03_03", + "doc": "Check that you can upsert a batch of existing entities", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Existing Entities Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${entities_to_be_upserted}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_04.json b/doc/files/ContextInformation/Provision/004_04.json new file mode 100644 index 0000000000000000000000000000000000000000..8ddb44133f6f3706dc35fe9edd20a02dd6685cd1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_04.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_04", + "test_objective": "Check that you can upsert a batch of entities with update option", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "004_04_01 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_04_01", + "doc": "Check that you can upsert a batch of entities with update option", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entities With Update Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'update' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_04_02 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_04_02", + "doc": "Check that you can upsert a batch of entities with update option", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entities With Update Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'update' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + }, + { + "name": "004_04_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_04_03", + "doc": "Check that you can upsert a batch of entities with update option", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entities", + "template": "Batch Upsert Entities With Update Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 201 and\n Batch Upsert Entities with Response Body set to an array of created entities ids and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'update' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_05.json b/doc/files/ContextInformation/Provision/004_05.json new file mode 100644 index 0000000000000000000000000000000000000000..2b7aa4e5213ecf75c8654f428164280b44f52124 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_05.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_05", + "test_objective": "Check that you can upsert a batch of entities where some will succeed and others will fail", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "004_05_01 Upsert a batch of two valid entities and one invalid entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_05_01", + "doc": "Check that you can upsert a batch of two valid entities and one invalid entity", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": "Delete Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Upsert Entities with Response Status Code set to 207 and\n Batch Upsert Entities with Response body containing batch operation result set to '${expected_batch_operation_result}' and\n Query Entities with Updated Entities set to '${upserted_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert?options=${update_option}'\n method set to 'POST'\n Request batch upsert operation over entity from filename '@{entities_to_be_upserted}' with update_option set to 'replace' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/004_06.json b/doc/files/ContextInformation/Provision/004_06.json new file mode 100644 index 0000000000000000000000000000000000000000..5fc8e198e35926aabe9c091b3d1fe68bd98905b0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_06.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/004_06", + "test_objective": "Check that you cannot upsert a batch of entities with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.8", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_8", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "004_06_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_06_01", + "doc": "Check that you cannot upsert a batch of entities with an invalid request", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": null, + "template": "Batch Upsert Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'upsert', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert" + }, + { + "name": "004_06_02 InvalidJsonLd", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/004_06_02", + "doc": "Check that you cannot upsert a batch of entities with an invalid request", + "tags": [ + "5_6_8", + "be-upsert" + ], + "setup": null, + "teardown": null, + "template": "Batch Upsert Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/upsert'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'upsert', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-ld-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/upsert" + } + ], + "permutations": [ + "when", + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities", + "robotfile": "004_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/005_01.json b/doc/files/ContextInformation/Provision/005_01.json new file mode 100644 index 0000000000000000000000000000000000000000..ca5d74d82c792976d18d8434c0d5631c7e34651d --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_01.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/005_01", + "test_objective": "Check that you can update a batch of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.9", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_9", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "005_01_01 EntityWithSimpleProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_01_01", + "doc": "Check that you can update a batch of entities", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + }, + { + "name": "005_01_02 EntityWithSimpleRelationships", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_01_02", + "doc": "Check that you can update a batch of entities", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + }, + { + "name": "005_01_03 EntityWithRelationshipsProperties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_01_03", + "doc": "Check that you can update a batch of entities", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities", + "robotfile": "005_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/005_02.json b/doc/files/ContextInformation/Provision/005_02.json new file mode 100644 index 0000000000000000000000000000000000000000..57e8775c45dcc99e70af8d6ed7f13a68e13e127c --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_02.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/005_02", + "test_objective": "Check that you can update a batch of entities with noOverwrite option", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.9", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_9", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "005_02_01 EntityWithExistingAttributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_02_01", + "doc": "Check that you can update a batch of entities with noOverwrite option", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity With NoOverwrite Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + }, + { + "name": "005_02_02 EntityWithNewAttribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_02_02", + "doc": "Check that you can update a batch of entities with noOverwrite option", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity With NoOverwrite Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + }, + { + "name": "005_02_03 EntityWithNewAndExistingAttribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_02_03", + "doc": "Check that you can update a batch of entities with noOverwrite option", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": "Setup Initial Entities", + "teardown": "Delete Initial Entities", + "template": "Batch Update Entity With NoOverwrite Option Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 204 and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities", + "robotfile": "005_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/005_03.json b/doc/files/ContextInformation/Provision/005_03.json new file mode 100644 index 0000000000000000000000000000000000000000..4f20d67a4d1e00ddfffa81ac2aebc9ad1df3e740 --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/005_03", + "test_objective": "Check that you can update a batch of entities where some will succeed and others will fail", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.9", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_9", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "005_03_01 Update a batch of non-existing and existing entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_03_01", + "doc": "Check that you can update a batch of non-existing and existing entities", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Update Entities with Response Status Code set to 207 and\n Batch Update Entities with Response body containing batch operation result set to '${expected_batch_operation_result}' and\n Query Entities with Updated Entities set to '${updated_entities}' valid entities\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update?${params_as_string}'\n method set to 'POST'\n Request batch update operation over entity from filename '@{entities_to_be_updated}' with overwrite_option set to '${EMPTY}' and Content-Type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities", + "robotfile": "005_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/005_04.json b/doc/files/ContextInformation/Provision/005_04.json new file mode 100644 index 0000000000000000000000000000000000000000..db986616985ee1039f1c319cda5aca5a28b6d162 --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_04.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/005_04", + "test_objective": "Check that you cannot update a batch of entities with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.9", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_9", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "005_04_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_04_01", + "doc": "Check that you cannot update a batch of entities with an invalid request", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": null, + "teardown": null, + "template": "Batch Update Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'update', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update" + }, + { + "name": "005_04_02 InvalidJsonLd", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/005_04_02", + "doc": "Check that you cannot update a batch of entities with an invalid request", + "tags": [ + "5_6_9", + "be-update" + ], + "setup": null, + "teardown": null, + "template": "Batch Update Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/update'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'update', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-ld-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/update" + } + ], + "permutations": [ + "when", + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities", + "robotfile": "005_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/006_01.json b/doc/files/ContextInformation/Provision/006_01.json new file mode 100644 index 0000000000000000000000000000000000000000..75e9fd5d52473f621211a0966323f10dd7c1745a --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/006_01", + "test_objective": "Check that you can delete a batch of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_10", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n and containing a list of entities\n}", + "test_cases": [ + { + "name": "006_01_01 Delete a batch of entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/006_01_01", + "doc": "Check that you can delete a batch of entities", + "tags": [ + "5_6_10", + "be-delete" + ], + "setup": "Setup Initial Entities", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Delete Entities with Response Status Code set to 204 and\n Query Entities with Response body is empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/delete'\n method set to 'POST'\n Batch Delete Entities: and\n Query Parameter: entities_ids_to_be_deleted set to '@{entities_ids_to_be_deleted}'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/delete" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities", + "robotfile": "006_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/006_02.json b/doc/files/ContextInformation/Provision/006_02.json new file mode 100644 index 0000000000000000000000000000000000000000..b43c0b51929da13deb95be43985e02efd8ddadc4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/006_02", + "test_objective": "Check that you can delete a batch of entities where some will succeed and others will fail", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_10", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "006_02_01 Delete a batch of non-existing and existing entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/006_02_01", + "doc": "Check that you can delete a batch of non-existing and existing entities", + "tags": [ + "5_6_10", + "be-delete" + ], + "setup": "Setup Initial Entity", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Delete Entities with Response Status Code set to 207 and\n ${response.json()} with Response body containing batch operation result set to '${response1}' and\n Query Entities with Response body is empty\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/delete'\n method set to 'POST'\n Batch Delete Entities: and\n Query Parameter: entities_ids_to_be_deleted set to '@{entities_ids_to_be_deleted}'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/delete" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities", + "robotfile": "006_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/006_03.json b/doc/files/ContextInformation/Provision/006_03.json new file mode 100644 index 0000000000000000000000000000000000000000..7c16cd7c22142d2c7b1a3b03e427112572713399 --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_03.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/BE/006_03", + "test_objective": "Check that you cannot delete a batch of entities with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_10", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "006_03_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/006_03_01", + "doc": "Check that you cannot delete a batch of entities with an invalid request", + "tags": [ + "5_6_10", + "be-delete" + ], + "setup": null, + "teardown": null, + "template": "Batch Delete Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/delete'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'delete', Content-Type set to 'application/ld+json', and body set to 'batch/invalid-json-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/delete" + }, + { + "name": "006_03_02 EmptyJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/006_03_02", + "doc": "Check that you cannot delete a batch of entities with an invalid request", + "tags": [ + "5_6_10", + "be-delete" + ], + "setup": null, + "teardown": null, + "template": "Batch Delete Entity With Invalid Request Scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Batch Request Entities From File with Response Status Code set to 400 and\n Batch Request Entities From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Batch Request Entities From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/delete'\n method set to 'POST'\n Batch Entity Delete Request with operation set to 'delete', Content-Type set to 'application/ld+json', and body set to 'batch/empty-sample.jsonld\n}", + "http_verb": "POST", + "endpoint": "entityOperations/delete" + } + ], + "permutations": [ + "when", + "then" + ], + "robotpath": "ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities", + "robotfile": "006_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/007_01.json b/doc/files/ContextInformation/Provision/007_01.json new file mode 100644 index 0000000000000000000000000000000000000000..6f38a5fa62ddc426178e962d61703919df251b03 --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/007_01", + "test_objective": "Check that you can create a temporal representation of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.11", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_11", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "007_01_01 Create a temporal representation of an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_01_01", + "doc": "Check that you can create a temporal representation of an entity", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": "Delete Temporal Entity", + "template": "Create Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Retrieve Temporal Representation Of Entity with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-create-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + }, + { + "name": "007_01_02 Create a temporal entity with no context", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_01_02", + "doc": "Check that you can create a temporal representation of an entity", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": "Delete Temporal Entity", + "template": "Create Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Retrieve Temporal Representation Of Entity with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-create-temporal-representation-without-context-sample.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity", + "robotfile": "007_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/007_02.json b/doc/files/ContextInformation/Provision/007_02.json new file mode 100644 index 0000000000000000000000000000000000000000..4756eb1cf0fa3c9f19d7250744682dcb15e0fe85 --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_02.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/007_02", + "test_objective": "Check that you cannot create a temporal entity with an empty/invalid json/id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.11", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_11", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "007_02_01 Create a temporal entity with an invalid json", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_02_01", + "doc": "Check that you cannot create a temporal entity with an empty/invalid json/id", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": null, + "template": "Create Temporal Entity From File", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 400 and\n Create Temporal Representation Of Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Create Temporal Representation Of Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: filename set to 'vehicle-temporal-representation-invalid-json-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + }, + { + "name": "007_02_02 Create a temporal entity with an empty json", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_02_02", + "doc": "Check that you cannot create a temporal entity with an empty/invalid json/id", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": null, + "template": "Create Temporal Entity From File", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 400 and\n Create Temporal Representation Of Entity Selecting Content Type with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Create Temporal Representation Of Entity Selecting Content Type with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: filename set to 'vehicle-temporal-representation-empty-json-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity", + "robotfile": "007_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/007_03.json b/doc/files/ContextInformation/Provision/007_03.json new file mode 100644 index 0000000000000000000000000000000000000000..784d6c03008a601aae195e40634ed294be937ea7 --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_03.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/007_03", + "test_objective": "Check that you cannot create a temporal entity with an empty/invalid json/id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.11", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_11", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "007_03_01 Create a temporal entity with missing id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_03_01", + "doc": "Check that you cannot create a temporal entity with an invalid @context", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": null, + "template": "Create Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${EMPTY}' and\n Query Parameter: filename set to 'vehicle-temporal-representation-without-id-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + }, + { + "name": "007_03_02 Create a temporal invalid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/007_03_02", + "doc": "Check that you cannot create a temporal entity with an invalid @context", + "tags": [ + "te-create", + "5_6_11" + ], + "setup": null, + "teardown": null, + "template": "Create Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to 'invalidId' and\n Query Parameter: filename set to 'vehicle-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity", + "robotfile": "007_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/008_01.json b/doc/files/ContextInformation/Provision/008_01.json new file mode 100644 index 0000000000000000000000000000000000000000..c60d5826015c6d1d969b150d8b9d8dd59b76173b --- /dev/null +++ b/doc/files/ContextInformation/Provision/008_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/008_01", + "test_objective": "Check that you can update a temporal representation of an entity with simple temporal properties", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.11", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_11", + "keywords": [ + "Delete Temporal Entity" + ], + "teardown": "Delete Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "008_01_01 Update a temporal representation of an entity with simple temporal properties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/008_01_01", + "doc": "Check that you can update a temporal representation of an entity with simple temporal properties", + "tags": [ + "5_6_11", + "te-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-create-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity", + "robotfile": "008_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/009_01.json b/doc/files/ContextInformation/Provision/009_01.json new file mode 100644 index 0000000000000000000000000000000000000000..398efebe7be8d4dddf86ada3832b25487c36cff4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/009_01", + "test_objective": "Check that you can delete a temporal representation of an entity with simple temporal properties", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.16", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_16", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "009_01_01 Delete a temporal representation of an entity with simple temporal properties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/009_01_01", + "doc": "Check that you can delete a temporal representation of an entity with simple temporal properties", + "tags": [ + "5_6_16", + "te-delete" + ], + "setup": "Create Initial Temporal Entity", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Temporal Representation Of Entity With Returning Response with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Response Status Code set to ${response1.status_code}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'DELETE'\n Delete Temporal Representation Of Entity With Returning Response with id set to '${temporal_entity_representation_id}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity", + "robotfile": "009_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/009_02.json b/doc/files/ContextInformation/Provision/009_02.json new file mode 100644 index 0000000000000000000000000000000000000000..165209505eb7303edcc494124f3fc3a057bcf11d --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_02.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/009_02", + "test_objective": "Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.16", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_16", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "009_02_01 Delete a temporal representation of an entity with an empty entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/009_02_01", + "doc": "Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId", + "tags": [ + "te-delete", + "5_6_16" + ], + "setup": null, + "teardown": null, + "template": "Delete Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Temporal Representation Of Entity With Returning Response with Response Status Code set to 405 and\n Delete Temporal Representation Of Entity With Returning Response with Response Body containing the type '${EMPTY}' and\n Delete Temporal Representation Of Entity With Returning Response with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'DELETE'\n Delete Temporal Representation Of Entity With Returning Response with id set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "009_02_02 Delete a temporal representation of an entity with an invalid entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/009_02_02", + "doc": "Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId", + "tags": [ + "te-delete", + "5_6_16" + ], + "setup": null, + "teardown": null, + "template": "Delete Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Temporal Representation Of Entity With Returning Response with Response Status Code set to 400 and\n Delete Temporal Representation Of Entity With Returning Response with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Temporal Representation Of Entity With Returning Response with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'DELETE'\n Delete Temporal Representation Of Entity With Returning Response with id set to 'invalidId'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "when", + "then" + ], + "robotpath": "ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity", + "robotfile": "009_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/009_03.json b/doc/files/ContextInformation/Provision/009_03.json new file mode 100644 index 0000000000000000000000000000000000000000..f9e7fa0d43e771435d127211d2c4da7e05f6984a --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TE/009_03", + "test_objective": "Check that an error is raised if you delete a temporal entity with a non-existing/invalid EntityId", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.16", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_16", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "009_03_01 Delete a temporal representation of an entity with an unknown entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TE/009_03_01", + "doc": "Check that an error is raised if you delete a temporal entity with a non-existing entity id", + "tags": [ + "5_6_16", + "te-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Temporal Representation Of Entity With Returning Response with Response Status Code set to 404 and\n Delete Temporal Representation Of Entity With Returning Response with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Temporal Representation Of Entity With Returning Response with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'DELETE'\n Delete Temporal Representation Of Entity With Returning Response with id set to '${temporal_entity_id}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity", + "robotfile": "009_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_01.json b/doc/files/ContextInformation/Provision/010_01.json new file mode 100644 index 0000000000000000000000000000000000000000..e87d84eba0b6debad3052ef97cbb3c2a1e08fb92 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01", + "test_objective": "Check that you can append entity attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_01_01 Append entity attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_01", + "doc": "Check that you can append entity attributes", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes Without Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-attribute-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + }, + { + "name": "010_01_02 Append entity attributes with different datasetid", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_02", + "doc": "Check that you can append entity attributes", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes Without Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_02.json b/doc/files/ContextInformation/Provision/010_02.json new file mode 100644 index 0000000000000000000000000000000000000000..e33d782d6c44aa30f24fc32ac845dcf4df4467fb --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_02.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_02", + "test_objective": "Check that you cannot append entity attributes with invalid/missing id or invalid request body", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_02_01 Append entity attributes if the entity Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_02_01", + "doc": "Check that you cannot append entity attributes with invalid/missing id or invalid request body", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 400 and\n Append Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Append Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${EMPTY}' and\n Query Parameter: fragment_filename set to 'vehicle-attribute-to-add-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + }, + { + "name": "010_02_02 Append entity attributes if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_02_02", + "doc": "Check that you cannot append entity attributes with invalid/missing id or invalid request body", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 400 and\n Append Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Append Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to 'thisisaninvaliduri' and\n Query Parameter: fragment_filename set to 'vehicle-attribute-to-add-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_03.json b/doc/files/ContextInformation/Provision/010_03.json new file mode 100644 index 0000000000000000000000000000000000000000..77cd8a65f833e3fcf679efca445b7417a3a12a40 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_03", + "test_objective": "Check that you cannot append entity attributes if the entity id is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_3", + "keywords": [ + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "010_03_01 Append entity attributes when the entity id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_03_01", + "doc": "Check that you cannot append entity attributes if the entity id is not known to the system", + "tags": [ + "5_6_3", + "ea-append" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 404 and\n Append Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Append Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-attribute-to-add-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_04.json b/doc/files/ContextInformation/Provision/010_04.json new file mode 100644 index 0000000000000000000000000000000000000000..23f35d0590c612954ea5651fb7da3a509f5b3c08 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_04.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_04", + "test_objective": "Check that you can append entity attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_04_01 Append entity attributes and ignore existing multi-attribute instance", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_04_01", + "doc": "Check that you can append entity attributes", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes With Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n ${expectation_filename} with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_response_body' and\n Query Parameter: response_body set to '' and\n Query Parameter: additional_ignored_path set to 'root\\\\['notUpdated'\\\\]\\\\[0\\\\]\\\\['reason'\\\\]' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs?options=${options}'\n method set to 'POST'\n Append entity attributes with parameters: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-attribute-to-add-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: options set to 'noOverwrite'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs?options=${options}" + }, + { + "name": "010_04_02 Append entity attributes with a new multi-attribute instance", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_04_02", + "doc": "Check that you can append entity attributes", + "tags": [ + "ea-append", + "5_6_3" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes With Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n ${expectation_filename} with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_response_body' and\n Query Parameter: response_body set to '' and\n Query Parameter: additional_ignored_path set to 'root\\\\['notUpdated'\\\\]\\\\[0\\\\]\\\\['reason'\\\\]' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs?options=${options}'\n method set to 'POST'\n Append entity attributes with parameters: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: options set to 'noOverwrite'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs?options=${options}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_05.json b/doc/files/ContextInformation/Provision/010_05.json new file mode 100644 index 0000000000000000000000000000000000000000..342e2574fece52c3a7468cc77825bf666287afc7 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_05.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_05", + "test_objective": "Check that you cannot append entity attributes with invalid/missing id or invalid request body", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_05_01 Append entity attributes with invalid entity fragments", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_05_01", + "doc": "Check that you cannot append entity attributes with invalid entity fragments", + "tags": [ + "5_6_3", + "ea-append" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 400 and\n Append Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Append Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'invalid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/011_01.json b/doc/files/ContextInformation/Provision/011_01.json new file mode 100644 index 0000000000000000000000000000000000000000..be00e166ecf53db730a50a73310e94473e6f9c17 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_01.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01", + "test_objective": "Check that you can update entity attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "011_01_01 Check that you can update existing attributes with no datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_01", + "doc": "Check that you can update entity attributes", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Test", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "011_01_02 Check that you can update existing attributes with the datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_02", + "doc": "Check that you can update entity attributes", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Test", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-02-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "011_01_03 Check that you can update only some attributes while unknown are ignored", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_03", + "doc": "Check that you can update entity attributes", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Test", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-03-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes", + "robotfile": "011_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/011_02.json b/doc/files/ContextInformation/Provision/011_02.json new file mode 100644 index 0000000000000000000000000000000000000000..3b39770060e8e77864fc789fdabb5b7f298d7ac8 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_02.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_02", + "test_objective": "Check that you cannot update entity attributes with invalid/missing id or invalid request body", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "011_02_01 Update an attribute if the Entity Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_02_01", + "doc": "Check that you cannot update entity attributes with invalid/missing id or invalid request body", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Environment", + "teardown": "Delete Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 400 and\n Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${EMPTY}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "011_02_02 Update an attribute if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_02_02", + "doc": "Check that you cannot update entity attributes with invalid/missing id or invalid request body", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Environment", + "teardown": "Delete Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 400 and\n Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to 'thisisaninvaliduri' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes", + "robotfile": "011_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/011_03.json b/doc/files/ContextInformation/Provision/011_03.json new file mode 100644 index 0000000000000000000000000000000000000000..33cabf8674c9119ccab6f8f745ddfc6f56fb1dfa --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_03", + "test_objective": "Check that you cannot update entity attributes if the entity id or attributes are not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_2", + "keywords": [ + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "011_03_01 Update entity attributes when the entity id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_03_01", + "doc": "Check that you cannot update entity attributes if the entity id or attributes are not known to the system", + "tags": [ + "5_6_2", + "ea-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 404 and\n Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes", + "robotfile": "011_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/011_04.json b/doc/files/ContextInformation/Provision/011_04.json new file mode 100644 index 0000000000000000000000000000000000000000..485694a53fc0485c7f5b5d8160803db54c584a3d --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_04.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_04", + "test_objective": "Check that you cannot update entity attributes with invalid/missing id or invalid request body", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "011_04_01 Update entity attributes with invalid entity fragments", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_04_01", + "doc": "Check that you cannot update an attribute if the entity fragment is invalid", + "tags": [ + "ea-update", + "5_6_2" + ], + "setup": "Initialize Environment", + "teardown": null, + "template": "Update entity attributes with invalid entity fragments", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 400 and\n Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes", + "robotfile": "011_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/012_01.json b/doc/files/ContextInformation/Provision/012_01.json new file mode 100644 index 0000000000000000000000000000000000000000..214c4284ca14989fa4824d750468bab499bb7a11 --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_01", + "test_objective": "Check that you can perform a partial update on an entity attribute", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "012_01_01 Check that you can partially update an attribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_01_01", + "doc": "Check that you can perform a partial update on an entity attribute", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Initiate Test Case", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'isParked' and\n Query Parameter: fragment_filename set to 'vehicle-isparked-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_01_02 Check that you can partially update an attribute by specifying the datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_01_02", + "doc": "Check that you can perform a partial update on an entity attribute", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Initiate Test Case", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-equal-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate", + "robotfile": "012_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/012_02.json b/doc/files/ContextInformation/Provision/012_02.json new file mode 100644 index 0000000000000000000000000000000000000000..39c1e02f8472ee21150fe7b61a71a72805541519 --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_02.json @@ -0,0 +1,82 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_02", + "test_objective": "Check that you cannot perform a partial update on an entity attribute with invalid/missing ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "012_02_01 Make a partial attribute update if the Entity Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_02_01", + "doc": "Check that you cannot perform a partial update on an entity attribute with invalid/missing ids", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 400 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${EMPTY}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-equal-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_02_02 Make a partial attribute update if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_02_02", + "doc": "Check that you cannot perform a partial update on an entity attribute with invalid/missing ids", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 400 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to 'thisisaninvaliduri' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-equal-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_02_03 Make a partial attribute update if the Attribute type does not match", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_02_03", + "doc": "Check that you cannot perform a partial update on an entity attribute with invalid/missing ids", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 400 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-equal-datasetid-different-type-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_02_04 Make a partial attribute update if the entity fragment is empty", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_02_04", + "doc": "Check that you cannot perform a partial update on an entity attribute with invalid/missing ids", + "tags": [ + "ea-partial-update", + "5_6_4" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 400 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'empty-fragment.json' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate", + "robotfile": "012_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/012_03.json b/doc/files/ContextInformation/Provision/012_03.json new file mode 100644 index 0000000000000000000000000000000000000000..d34e2f83955efaabee974ad207eb6eede3b5c0c0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_03.json @@ -0,0 +1,82 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_03", + "test_objective": "Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "012_03_01 Partial update when the Entity Id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_03_01", + "doc": "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" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Partial Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 404 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${not_found_entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-isparked-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_03_02 Partial update when no default instance and no datasetId specified", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_03_02", + "doc": "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" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Partial Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 404 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-no-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_03_03 Partial update when no instance with the datasetId specified", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_03_03", + "doc": "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" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Partial Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 404 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-unknown-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "012_03_04 Partial update when the Attribute Name does not exist in the entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_03_04", + "doc": "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" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Partial Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 404 and\n Partial Update Entity Attributes with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Partial Update Entity Attributes with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: AttributeId set to 'isParked2' and\n Query Parameter: fragment_filename set to 'vehicle-isparked-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate", + "robotfile": "012_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_01.json b/doc/files/ContextInformation/Provision/013_01.json new file mode 100644 index 0000000000000000000000000000000000000000..fa912c9c88881ccd9bed2bbbbb4cd2e4c2e84e64 --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_01.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01", + "test_objective": "Check that you can delete an attribute from an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "013_01_01 Delete an attribute with the default instance", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_01", + "doc": "Check that you can delete an attribute from an entity", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_01_02 Delete an attribute with the datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_02", + "doc": "Check that you can delete an attribute from an entity", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_01_03 Delete all target attribute instances", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_03", + "doc": "Check that you can delete an attribute from an entity", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entities", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_02.json b/doc/files/ContextInformation/Provision/013_02.json new file mode 100644 index 0000000000000000000000000000000000000000..8cbbbb19e2d576cc1756d266db6267148bc9f184 --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_02.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_02", + "test_objective": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "013_02_01 Delete an attribute if the Entity Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_02_01", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${EMPTY}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_02_02 Delete an attribute if the Entity Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_02_02", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to 'thisIsAnInvalidURI' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_02_03 Delete an attribute if the Attribute Name is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_02_03", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 405\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: attributeId set to '${EMPTY}' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_03.json b/doc/files/ContextInformation/Provision/013_03.json new file mode 100644 index 0000000000000000000000000000000000000000..cf0984c011b7c9685a4739bb3942150fcda688b5 --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_03.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_03", + "test_objective": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "013_03_01 Delete an attribute when the Entity Id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_03_01", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Entity Attributes with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${not_found_entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_03_02 Delete an attribute when the Entity does not contain the target attribute id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_03_02", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Entity Attributes with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: attributeId set to 'notFound' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "013_03_03 Delete an attribute when the Entity does not contain the target attribute with same datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_03_03", + "doc": "Check that you cannot delete an attribute from an entity with invalid/missing ids", + "tags": [ + "ea-delete", + "5_6_5" + ], + "setup": "Setup Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Delete Attributes", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Entity Attributes with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${valid_entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to 'false'\n}", + "http_verb": "DELETE", + "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/014_01.json b/doc/files/ContextInformation/Provision/014_01.json new file mode 100644 index 0000000000000000000000000000000000000000..6b7b71b3fb97fb3f4c88d183d72f7c500a22a24f --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_01", + "test_objective": "Check that you can add a simple temporal attribute to a temporal representation of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.12", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_12", + "keywords": [ + "Delete Temporal Entity" + ], + "teardown": "Delete Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "014_01_01 Add an attribute to a temporal entity with simple temporal properties", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_01_01", + "doc": "Check that you can add a simple temporal attribute to a temporal representation of an entity", + "tags": [ + "5_6_12", + "tea-append" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/AddAttributes", + "robotfile": "014_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/014_02.json b/doc/files/ContextInformation/Provision/014_02.json new file mode 100644 index 0000000000000000000000000000000000000000..82b0c7a0a6b853beb759b7bbf63e8028993ccedf --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_02.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_02", + "test_objective": "Check that an error is raised if you add an attribute to a temporal entity with invalid content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.12", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_12", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "014_02_01 Add an attribute to a temporal representation of an entity with an empty entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_02_01", + "doc": "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" + ], + "setup": null, + "teardown": null, + "template": "Add Attribute To Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${EMPTY}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + }, + { + "name": "014_02_02 Add an attribute to a temporal representation of an entity with an invalid entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_02_02", + "doc": "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" + ], + "setup": null, + "teardown": null, + "template": "Add Attribute To Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to 'thisIsAninvalidId' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/AddAttributes", + "robotfile": "014_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/014_03.json b/doc/files/ContextInformation/Provision/014_03.json new file mode 100644 index 0000000000000000000000000000000000000000..666f853ebd7f40c6e894474523746af2862387f1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_03", + "test_objective": "Check that an error is raised if you add an attribute to a non-existent entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.12", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_12", + "keywords": [ + "Delete Temporal Entity" + ], + "teardown": "Delete Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "014_03_01 Add Attribute To Temporal Entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_03_01", + "doc": "Check that an error is raised if you add an attribute to a non-existent entity", + "tags": [ + "5_6_12", + "tea-append" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${not_found_temporal_entity_representation_id}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/AddAttributes", + "robotfile": "014_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/014_04.json b/doc/files/ContextInformation/Provision/014_04.json new file mode 100644 index 0000000000000000000000000000000000000000..bb7f5ced057113b160828743008cde019f7ef1ed --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_04.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_04", + "test_objective": "Check that an error is raised if you add a temporal entity attribute with empty/invalid content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.12", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_12", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "014_04_01 Add an attribute to a temporal representation of an entity with invalid content", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_04_01", + "doc": "Check that an error is raised if you add a temporal entity attribute with empty/invalid content", + "tags": [ + "tea-append", + "5_6_12" + ], + "setup": "Initialize Test Case", + "teardown": null, + "template": "Add an Attribute To a Temporal Entity From File", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Attribute To Temporal Entity with Response Status Code set to 400 and\n Append Attribute To Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Append Attribute To Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-invalid-json-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + }, + { + "name": "014_04_02 Add an attribute to a temporal representation of an entity with empty content", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/014_04_02", + "doc": "Check that an error is raised if you add a temporal entity attribute with empty/invalid content", + "tags": [ + "tea-append", + "5_6_12" + ], + "setup": "Initialize Test Case", + "teardown": null, + "template": "Add an Attribute To a Temporal Entity From File", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Attribute To Temporal Entity with Response Status Code set to 400 and\n Append Attribute To Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Append Attribute To Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-empty-json-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/AddAttributes", + "robotfile": "014_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/015_01.json b/doc/files/ContextInformation/Provision/015_01.json new file mode 100644 index 0000000000000000000000000000000000000000..7596620f16f36e49cce45a649c04e675f85922e4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_01.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_01", + "test_objective": "Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.13", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_13", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "015_01_01 Delete an attribute from a temporal representation of an entity without deleteAll/datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_01_01", + "doc": "Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties", + "tags": [ + "tea-delete", + "5_6_13" + ], + "setup": "Initialize Setup", + "teardown": "Delete Temporal Entity", + "template": "Delete Attribute From A Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "015_01_02 Delete an attribute from a temporal representation of an entity with datasetId", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_01_02", + "doc": "Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties", + "tags": [ + "tea-delete", + "5_6_13" + ], + "setup": "Initialize Setup", + "teardown": "Delete Temporal Entity", + "template": "Delete Attribute From A Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "015_01_03 Delete an attribute from a temporal representation of an entity with deleteAll", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_01_03", + "doc": "Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties", + "tags": [ + "tea-delete", + "5_6_13" + ], + "setup": "Initialize Setup", + "teardown": "Delete Temporal Entity", + "template": "Delete Attribute From A Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute", + "robotfile": "015_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/015_02.json b/doc/files/ContextInformation/Provision/015_02.json new file mode 100644 index 0000000000000000000000000000000000000000..10c3eb798de3df51718436fc126d3138bcd7f732 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_02.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_02", + "test_objective": "Check that an error is raised if you delete an attribute to temporal entity with an unknown/invalid Entity/Attribute Id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.13", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_13", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "015_02_01 Delete an attribute to a temporal representation of an entity with a missing entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_02_01", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute from temporal entity with unknow entity/attribute id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 400 and\n Delete Attribute From Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Attribute From Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${EMPTY}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "015_02_02 Delete an attribute to a temporal representation of an entity with an invalid entity id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_02_02", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute from temporal entity with unknow entity/attribute id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 400 and\n Delete Attribute From Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Attribute From Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to 'invalidId' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "015_02_03 Delete an attribute to a temporal representation of an entity with an invalid attribute id", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_02_03", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute from temporal entity with unknow entity/attribute id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 400 and\n Delete Attribute From Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Attribute From Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${valid_temporal_entity_id}' and\n Query Parameter: attributeId set to 'invalid(Name' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute", + "robotfile": "015_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/015_03.json b/doc/files/ContextInformation/Provision/015_03.json new file mode 100644 index 0000000000000000000000000000000000000000..d013e2bd5613f78b053a08cb4dff3ea05cef8085 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_03.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_03", + "test_objective": "Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.13", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_13", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "015_03_01 Delete an attribute to a temporal entity if the entity id does not exist", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_03_01", + "doc": "Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id", + "tags": [ + "tea-delete", + "5_6_13" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Delete An Attribute", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 404 and\n Delete Attribute From Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Attribute From Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${unknown_temporal_entity_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + }, + { + "name": "015_03_02 Delete an attribute to a temporal entity if the entity does not contain the target attribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/015_03_02", + "doc": "Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id", + "tags": [ + "tea-delete", + "5_6_13" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Delete An Attribute", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 404 and\n Delete Attribute From Temporal Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Attribute From Temporal Entity with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${valid_temporal_entity_id}' and\n Query Parameter: attributeId set to 'notExistingAttribute' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${EMPTY}' and\n Query Parameter: deleteAll set to 'false' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute", + "robotfile": "015_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/016_01.json b/doc/files/ContextInformation/Provision/016_01.json new file mode 100644 index 0000000000000000000000000000000000000000..153cf064c0b9aff122bbafdca6be231a1263f45c --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_01", + "test_objective": "Check that you can modify an attribute instance in temporal representation of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.14", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_14", + "keywords": [ + "Delete Intitial Temporal Representation Of Entity" + ], + "teardown": "Delete Intitial Temporal Representation Of Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "016_01_01 Modify attribute instance in temporal representation of an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_01_01", + "doc": "Check that you can partially update an attribute instance of a temporal representation of an entity", + "tags": [ + "5_6_14", + "tea-partial-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance", + "robotfile": "016_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/016_02.json b/doc/files/ContextInformation/Provision/016_02.json new file mode 100644 index 0000000000000000000000000000000000000000..c9740ac1d21ad30a62fb9275a912e2c4892ff07c --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_02.json @@ -0,0 +1,115 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02", + "test_objective": "Check that you cannot modify an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.14", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_14", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "016_02_01 Modify attribute instance in temporal representation of an entity if the entity id is not valid", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_01", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to 'invalidId' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_02_02 Modify attribute instance in temporal representation of an entity if the entity id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_02", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${EMPTY}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_02_03 Modify attribute instance in temporal representation of an entity if the instance id is not valid", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_03", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_02_04 Modify attribute instance in temporal representation of an entity if the instance id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_04", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 405\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_02_05 Modify attribute instance in temporal representation of an entity if the attribute name is not a valid name", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_05", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_02_06 Modify attribute instance in temporal representation of an entity if the attribute name is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_02_06", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 405\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + } + ], + "permutations": [ + "when", + "then" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance", + "robotfile": "016_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/016_03.json b/doc/files/ContextInformation/Provision/016_03.json new file mode 100644 index 0000000000000000000000000000000000000000..d516bf5c3d8826593f726ae6c00488d0f8182a56 --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_03.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_03", + "test_objective": "Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not found", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.14", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_14", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "016_03_01 Modify attribute instance in temporal representation of an entity if the entity with given id is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_03_01", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${unknown_temporal_entity_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_03_02 Modify attribute instance in temporal representation of an entity if the target attribute is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_03_02", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "016_03_03 Modify attribute instance in temporal representation of an entity if the target attribute instance is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/016_03_03", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Temporal Entity", + "template": "Modify Attribute Instance Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'PATCH'\n Modify Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-modify-attribute-instance-fragment.jsonld' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "PATCH", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance", + "robotfile": "016_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/017_01.json b/doc/files/ContextInformation/Provision/017_01.json new file mode 100644 index 0000000000000000000000000000000000000000..2da4cc8ae175aa49d4dc187ac4fe7b677305f12f --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_01", + "test_objective": "Check that you can delete an attribute instance in temporal representation of an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.15", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_15", + "keywords": [ + "Delete Temporal Entity" + ], + "teardown": "Delete Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "017_01_01 Delete an attribute instance in temporal representation of an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_01_01", + "doc": "Check that you can delete an attribute instance in temporal representation of an entity", + "tags": [ + "5_6_15", + "tea-instance-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/speed/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/speed/{instanceId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance", + "robotfile": "017_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/017_02.json b/doc/files/ContextInformation/Provision/017_02.json new file mode 100644 index 0000000000000000000000000000000000000000..7c64617ca55eb2a9323d3be610b4bd44178ed97c --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_02.json @@ -0,0 +1,98 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02", + "test_objective": "Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.15", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_15", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "017_02_01 Delete an attribute instance in temporal representation of an entity if the entity id is not valid", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02_01", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to 'invalidId' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_02_02 Delete an attribute instance in temporal representation of an entity if the entity id is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02_02", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${EMPTY}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_02_03 Delete an attribute instance in temporal representation of an entity if the instance id is not valid", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02_03", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_02_04 Delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02_04", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_02_05 Delete an attribute instance in temporal representation of an entity if the attribute name is not present", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_02_05", + "doc": "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" + ], + "setup": "Create Temporal Entity", + "teardown": "Delete Temporal Entity", + "template": "Delete attribute instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance", + "robotfile": "017_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/017_03.json b/doc/files/ContextInformation/Provision/017_03.json new file mode 100644 index 0000000000000000000000000000000000000000..795f6b22bbecce867122d0a9f675102b8f4cb674 --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_03.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_03", + "test_objective": "Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.15", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_15", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Temporal Entity ${entity} \n with an id set to ${temporal_entity_representation_id} \n}", + "test_cases": [ + { + "name": "017_03_01 Delete an attribute instance in temporal representation of an entity if the entity with given id is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_03_01", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Intitial Temporal Representation Of Entity", + "template": "Delete An Attribute Instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${unknown_temporal_entity_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_03_02 Delete an attribute instance in temporal representation of an entity if the target attribute is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_03_02", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Intitial Temporal Representation Of Entity", + "template": "Delete An Attribute Instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + }, + { + "name": "017_03_03 Delete an attribute instance in temporal representation of an entity if the target attribute instance is not found", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/TEA/017_03_03", + "doc": "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" + ], + "setup": "Create Id", + "teardown": "Delete Intitial Temporal Representation Of Entity", + "template": "Delete An Attribute Instance", + "then": "then {\n the SUT sends a valid Response for the operation:\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to '${attributeId}' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "temporal/entities/{temporal_entity_id}/attrs/{attributeId}/{instanceId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance", + "robotfile": "017_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/028_01.json b/doc/files/ContextInformation/Subscription/028_01.json new file mode 100644 index 0000000000000000000000000000000000000000..825c43d2ff5ff5f4c4ccc96d313a9b527ae4446e --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/028_01", + "test_objective": "Check that you can create a subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_1", + "keywords": [ + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "028_01_01 Create Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_01_01", + "doc": "Check that you can create a subscription", + "tags": [ + "5_8_1", + "sub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/CreateSubscription", + "robotfile": "028_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/028_02.json b/doc/files/ContextInformation/Subscription/028_02.json new file mode 100644 index 0000000000000000000000000000000000000000..6738587781b6ec63bcbd617fa6858d54e52afb27 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_02.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/028_02", + "test_objective": "Check that you cannot create a subscription with an invalid request", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "028_02_01 InvalidJson", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_02_01", + "doc": "Check that you cannot create a subscription with an invalid request", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid Request", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription From File with Response Status Code set to 400 and\n Create Subscription From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Create Subscription From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Create Subscription Request with Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscription-invalid-json-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "028_02_02 EmptyJson", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_02_02", + "doc": "Check that you cannot create a subscription with an invalid request", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid Request", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription From File with Response Status Code set to 400 and\n Create Subscription From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Subscription From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Create Subscription Request with Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscription-empty-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Subscription/CreateSubscription", + "robotfile": "028_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/028_03.json b/doc/files/ContextInformation/Subscription/028_03.json new file mode 100644 index 0000000000000000000000000000000000000000..5d78e548ac8ad6414b9e333d262093f302c7c7fb --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_03.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/028_03", + "test_objective": "Check that you cannot create a subscription with an invalid/empty id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_1", + "keywords": [ + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "028_03_01 InvalidId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_03_01", + "doc": "Check that you cannot create a subscription with an invalid/empty id", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid/Empty Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 400 and\n Create Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "028_03_02 EmptyId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_03_02", + "doc": "Check that you cannot create a subscription with an invalid/empty id", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid/Empty Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 400 and\n Create Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/CreateSubscription", + "robotfile": "028_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/028_04.json b/doc/files/ContextInformation/Subscription/028_04.json new file mode 100644 index 0000000000000000000000000000000000000000..ac2c0628aac2a2abbad2098beeaab5a9aa44e2b3 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/028_04", + "test_objective": "Check that you cannot create a subscription with an existing id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_1", + "keywords": [ + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "028_04_01 Create a subscription with an id known to the system", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_04_01", + "doc": "Check that you cannot create a subscription with an existing id", + "tags": [ + "5_8_1", + "sub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 409 and\n Create Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists' and\n Create Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/CreateSubscription", + "robotfile": "028_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_01.json b/doc/files/ContextInformation/Subscription/029_01.json new file mode 100644 index 0000000000000000000000000000000000000000..7df9d7b7960dd29411437c89421e3902e517357a --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_01", + "test_objective": "Check that you cannot update 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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_01_01 NotPresentId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_01_01", + "doc": "Check that you cannot update a subscription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": "Update Subscription With Non present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 405 and\n Update Subscription with Response Body containing the type '${EMPTY}' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + }, + { + "name": "029_01_02 InvalidId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_01_02", + "doc": "Check that you cannot update a subscription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": "Update Subscription With Non present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 400 and\n Update Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_02.json b/doc/files/ContextInformation/Subscription/029_02.json new file mode 100644 index 0000000000000000000000000000000000000000..f4bff5b6bf87c121acb52d742b50fb4bcbe61003 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_02_01 Update Unknown Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_02_01", + "doc": "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": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 404 and\n Update Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_03.json b/doc/files/ContextInformation/Subscription/029_03.json new file mode 100644 index 0000000000000000000000000000000000000000..5b4dad98a076715572bf5791826a4fb1a54de313 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_03", + "test_objective": "Check that you cannot update a subscription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_03_01 Update Subscription With Invalid Fragment", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_03_01", + "doc": "Check that you cannot update a subscription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 400 and\n Update Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-invalid-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_04.json b/doc/files/ContextInformation/Subscription/029_04.json new file mode 100644 index 0000000000000000000000000000000000000000..3f6d73071bdba976e70848e4a16666e4a67afcb5 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_04", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_04_01 Update Subscription With Null Mandatory Properties", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_04_01", + "doc": "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": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 400 and\n Update Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-null-properties-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_05.json b/doc/files/ContextInformation/Subscription/029_05.json new file mode 100644 index 0000000000000000000000000000000000000000..c324f51ef80e323b672e56a80660b2094db47a33 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_05.json @@ -0,0 +1,53 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_05", + "test_objective": "Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_05_01 Update Subscription With Term to Uri Expansion with Context", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_05_01", + "doc": "Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Response Body containing the same content defined in file 'subscriptions/expectations/subscription-vehicle-sample.jsonld' with subscription id '${subscription_id}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-vehicle-entities-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + }, + { + "name": "029_05_02 Update Subscription With Term to Uri Expansion without Context", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_05_02", + "doc": "Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Response Body containing the same content defined in file 'subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld' with subscription id '${subscription_id}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-vehicle-entities-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_06.json b/doc/files/ContextInformation/Subscription/029_06.json new file mode 100644 index 0000000000000000000000000000000000000000..8802e5b60ead47ae75d5dd372069cdbbfd9daa24 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_06.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_06", + "test_objective": "Check that you can update a subscription: The implementation shall modify the target Subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_06_01 Update Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_06_01", + "doc": "Check that you can update a subscription: The implementation shall modify the target Subscription", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_07.json b/doc/files/ContextInformation/Subscription/029_07.json new file mode 100644 index 0000000000000000000000000000000000000000..3c429666c13d7ea3593e411e53eb756d70df2f6a --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_07.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_07", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_07_01 ActiveTrue", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_07_01", + "doc": "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\"", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": "Activate Paused Subscription With isActive Member", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'active'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-isActive-true-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_08.json b/doc/files/ContextInformation/Subscription/029_08.json new file mode 100644 index 0000000000000000000000000000000000000000..6e5d90e54a653b8a2f1a3e8f1c4178f16890db9b --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_08.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_08", + "test_objective": "Check that you can update a subscription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to \"active\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_08_01 ActiveTrueExpiresAt", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_08_01", + "doc": "Check that you can update a subscription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to \"active\"", + "tags": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": "Activate Paused Subscription With isActive And ExpiresAt Members", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'active'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_09.json b/doc/files/ContextInformation/Subscription/029_09.json new file mode 100644 index 0000000000000000000000000000000000000000..05b279fd7a361aaf6136c1d66c15471e54e855d3 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_09.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_09", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_09_01 Update Subscription Status To Paused", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_09_01", + "doc": "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": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'paused'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-isActive-false-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_10.json b/doc/files/ContextInformation/Subscription/029_10.json new file mode 100644 index 0000000000000000000000000000000000000000..aed5d2afffa0d28c18a3e0586a5f00ad08959058 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_10.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_10", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_10_01 Activate Expired Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_10_01", + "doc": "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": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'active'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file '${subscription_update_fragment_file_path}'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/029_11.json b/doc/files/ContextInformation/Subscription/029_11.json new file mode 100644 index 0000000000000000000000000000000000000000..47445fadbb670ebde5d09c29ebf2fb31f343f27c --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_11.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/029_11", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_2", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "029_11_01 Update Subscription With ExpiresAt In The Past", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/029_11_01", + "doc": "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": [ + "5_8_2", + "sub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 400 and\n Update Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-expiresAt-update-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/UpdateSubscription", + "robotfile": "029_11" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/030_01.json b/doc/files/ContextInformation/Subscription/030_01.json new file mode 100644 index 0000000000000000000000000000000000000000..070fccfe3b672ccab7bce3528956796945f509e1 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/030_01", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "030_01_01 InvalidId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/030_01_01", + "doc": "Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised", + "tags": [ + "5_8_3", + "sub-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Subscription With Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Subscription with Response Status Code set to 400 and\n Retrieve Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to 'InvalidUri'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/RetrieveSubscription", + "robotfile": "030_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/030_02.json b/doc/files/ContextInformation/Subscription/030_02.json new file mode 100644 index 0000000000000000000000000000000000000000..d168aeffa3b53114fd9ea44624022207cc0614b8 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/030_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "030_02_01 Retrieve Unknown Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/030_02_01", + "doc": "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": [ + "5_8_3", + "sub-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Subscription with Response Status Code set to 404 and\n Retrieve Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to 'urn:ngsi-ld:Subscription:unknowSubscription'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/RetrieveSubscription", + "robotfile": "030_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/030_03.json b/doc/files/ContextInformation/Subscription/030_03.json new file mode 100644 index 0000000000000000000000000000000000000000..df59b54119e229c9a2765f4e2d8e87ccd25bbeba --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/030_03", + "test_objective": "Check that you can retrieve a subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_3", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "030_03_01 Retrieve Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/030_03_01", + "doc": "Check that you can retrieve a subscription", + "tags": [ + "5_8_3", + "sub-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Subscription with Response Status Code set to 200 and\n Retrieve Subscription with Response Body containing the same content defined in file 'subscriptions/expectations/subscriptions-030-03-expectation.json' with subscription id '${subscription_id}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${subscription_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/RetrieveSubscription", + "robotfile": "030_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/031_01.json b/doc/files/ContextInformation/Subscription/031_01.json new file mode 100644 index 0000000000000000000000000000000000000000..aeb8708c5d62b4254126060feb275661920e51e4 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/031_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/031_01", + "test_objective": "Check that you can query a list of subscriptions", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_4", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "teardown": "Delete Initial Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "031_01_01 Query Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/031_01_01", + "doc": "Check that you can query a list of subscriptions", + "tags": [ + "5_8_4", + "sub-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Subscriptions with Response Status Code set to 200 and\n Query Subscriptions with Response containing:\n * file set to 'subscriptions/expectations/subscriptions-031-01-expectation.json'\n * id set to '${subscription_ids}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'GET'\n Query Subscription Request with data: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/QuerySubscriptions", + "robotfile": "031_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/031_02.json b/doc/files/ContextInformation/Subscription/031_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a016811ef0f525419a917e03825a50c86e20371a --- /dev/null +++ b/doc/files/ContextInformation/Subscription/031_02.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/031_02", + "test_objective": "Check that you can query a list of subscriptions: Pagination logic shall be in place", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Subscription ${subscription} \n with an id set to ${subscription_id} \n}", + "test_cases": [ + { + "name": "031_02_01 Query Second Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/031_02_01", + "doc": "Check that you can query a list of subscriptions: Pagination logic shall be in place", + "tags": [ + "5_8_4", + "sub-query" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "Delete Initial Subscriptions", + "template": "Query Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Subscriptions with Response Status Code set to 200 and\n Query Subscriptions with Response Body containing a list of entities equal to '${expectation_subscription_number}' of type 'Subscription' with response set to '${response.json()}' and\n Query Subscriptions with Response header with 'Prev' header equal to ';rel=\"next\";type=\"application/ld+json\"' and with 'Next' header equal to '${response.headers}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'GET'\n Query Subscription Request with data: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${1}' and\n Query Parameter: offset set to '${1}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/" + }, + { + "name": "031_02_02 Query Last Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/031_02_02", + "doc": "Check that you can query a list of subscriptions: Pagination logic shall be in place", + "tags": [ + "5_8_4", + "sub-query" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "Delete Initial Subscriptions", + "template": "Query Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Subscriptions with Response Status Code set to 200 and\n Query Subscriptions with Response Body containing a list of entities equal to '${expectation_subscription_number}' of type 'Subscription' with response set to '${response.json()}' and\n Query Subscriptions with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.headers}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'GET'\n Query Subscription Request with data: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${1}' and\n Query Parameter: offset set to '${2}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/" + }, + { + "name": "031_02_03 Query All Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/031_02_03", + "doc": "Check that you can query a list of subscriptions: Pagination logic shall be in place", + "tags": [ + "5_8_4", + "sub-query" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "Delete Initial Subscriptions", + "template": "Query Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Subscriptions with Response Status Code set to 200 and\n Query Subscriptions with Response Body containing a list of entities equal to '${expectation_subscription_number}' of type 'Subscription' with response set to '${response.json()}' and\n Query Subscriptions with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.headers}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'GET'\n Query Subscription Request with data: and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${15}' and\n Query Parameter: offset set to '${0}' and\n Query Parameter: accept set to 'application/ld+json'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Subscription/QuerySubscriptions", + "robotfile": "031_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/032_01.json b/doc/files/ContextInformation/Subscription/032_01.json new file mode 100644 index 0000000000000000000000000000000000000000..442f32778dbc1f7e8cc5a2dcf3d19c938ad07f7a --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/032_01", + "test_objective": "Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error shall be raised", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "032_01_01 NotPresentId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/032_01_01", + "doc": "Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error shall be raised", + "tags": [ + "5_8_5", + "sub-delete" + ], + "setup": null, + "teardown": null, + "template": "Delete Subscription With Non present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Subscription with Response Status Code set to 405 and\n Delete Subscription with Response Body containing the type '${EMPTY}' and\n Delete Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Subscription with id set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "subscriptions/{subscription_id}" + }, + { + "name": "032_01_02 InvalidId", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/032_01_02", + "doc": "Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error shall be raised", + "tags": [ + "5_8_5", + "sub-delete" + ], + "setup": null, + "teardown": null, + "template": "Delete Subscription With Non present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Subscription with Response Status Code set to 400 and\n Delete Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Subscription with id set to 'InvalidUri'\n}", + "http_verb": "DELETE", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Subscription/DeleteSubscription", + "robotfile": "032_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/032_02.json b/doc/files/ContextInformation/Subscription/032_02.json new file mode 100644 index 0000000000000000000000000000000000000000..264c267c3a83883013121ab2e0730b46d7bd0281 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/032_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "032_02_01 Delete Unknown Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/032_02_01", + "doc": "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": [ + "5_8_5", + "sub-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Subscription with Response Status Code set to 404 and\n Delete Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Subscription with id set to 'urn:ngsi-ld:Subscription:unknowSubscription'\n}", + "http_verb": "DELETE", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/DeleteSubscription", + "robotfile": "032_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/032_03.json b/doc/files/ContextInformation/Subscription/032_03.json new file mode 100644 index 0000000000000000000000000000000000000000..7d9afec508c26ba1fc7919f29c444ac016afd3ed --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/032_03", + "test_objective": "Check that you can delete a subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_5", + "keywords": [ + "Setup Initial Subscriptions" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "032_03_01 Delete Subscription", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/032_03_01", + "doc": "Check that you can delete a subscription", + "tags": [ + "5_8_5", + "sub-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Response Status Code set to ${response1.status_code}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Subscription with id set to '${subscription_id}'\n}", + "http_verb": "DELETE", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/DeleteSubscription", + "robotfile": "032_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_01.json b/doc/files/ContextInformation/Subscription/046_01.json new file mode 100644 index 0000000000000000000000000000000000000000..b45635aa9be66e7c378457ce829b9de63317378b --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_01.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_01", + "test_objective": "Check that a notification is only sent if and only if the status is active", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_01_01 Check that a notification is only sent if status is active", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_01_01", + "doc": "Check that a notification is only sent if and only if the status is active", + "tags": [ + "046_01", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][airQualityLevel][value]' equal to '${5}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'airQualityLevel-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_01" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_02.json b/doc/files/ContextInformation/Subscription/046_02.json new file mode 100644 index 0000000000000000000000000000000000000000..d332377bdcce2cb22abc9f6cab785e0ed458822d --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_02.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_02", + "test_objective": "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.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_02_01 Check that a notification is sent on the timeInterval", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_02_01", + "doc": "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": [ + "046_02", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '15' seconds and\n Notification received After waiting '15' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][name][value]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}' and\n Notification received The expression `'${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4'' should be True\n}", + "when": "The client at ${endpoint} receives a valid Notification containing a subscription with id set to ${subscriptionId} \n and status equals 'active'\n and timeInterval is set to '${timeInterval}'\n and watchedAttributes is 'Empty'\n and q is 'Empty'\n and geoQ is 'Empty'\n and with subscription.entity with type 'Building'\n and notification.endpoint.accept is 'application/json'\n \n When the timeinterval is reached at ${timeInterval} seconds\n the SUT needs to send out a notification to the client \n sends a notification to the client every ${timeInterval} seconds", + "http_verb": "", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_02" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_03.json b/doc/files/ContextInformation/Subscription/046_03.json new file mode 100644 index 0000000000000000000000000000000000000000..bbd4bc4e7cc26ffe4f7df10a651f67974308d8e6 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_03.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_03", + "test_objective": "A notification with all subscribed Entities will be included if query or geoquery are not defined.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_03_01 Check that a notification is sent with all entities", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_03_01", + "doc": "A notification with all subscribed Entities will be included if query or geoquery are not defined.", + "tags": [ + "046_03", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][name][value]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}' and\n Notification received The expression `'${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5'' should be True\n}", + "when": "The client at ${endpoint} receives a valid Notification containing a subscription with id set to ${subscriptionId} \n and status equals 'active'\n and timeInterval is set to '${timeInterval}'\n and watchedAttributes is 'Empty'\n and q is 'Empty'\n and geoQ is 'Empty'\n and with subscription.entity with type 'Building'\n and notification.endpoint.accept is 'application/json'\n \n When the timeinterval is reached at ${timeInterval} seconds\n the SUT needs to send out a notification to the client \n sends a notification to the client every ${timeInterval} seconds", + "http_verb": "", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_03" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_04.json b/doc/files/ContextInformation/Subscription/046_04.json new file mode 100644 index 0000000000000000000000000000000000000000..9947c7afc0936b45d777cf390378710b41e33161 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_04.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_04", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_04_01 Check that a notification is sent with all entities", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_04_01", + "doc": "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": [ + "046_04", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][airQualityLevel][value]' equal to '${5}' and\n Notification received Notification data: '${notification}[data][0][name][value]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}'\n}", + "when": "The client at ${endpoint} receives a valid Notification containing a subscription with id set to ${subscriptionId} \n and status equals 'active'\n and timeInterval is set to '${timeInterval}'\n and watchedAttributes is 'Empty'\n and q is 'Empty'\n and geoQ is 'Empty'\n and with subscription.entity with type 'Building'\n and notification.endpoint.accept is 'application/json'\n \n When the timeinterval is reached at ${timeInterval} seconds\n the SUT needs to send out a notification to the client \n sends a notification to the client every ${timeInterval} seconds", + "http_verb": "", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_04" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_05.json b/doc/files/ContextInformation/Subscription/046_05.json new file mode 100644 index 0000000000000000000000000000000000000000..52cd374c19c577cdd40496bf04e84b93bba1b89d --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_05.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_05", + "test_objective": "If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes and the entity matches the q parameter. 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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_05_01 Check that a notification is sent with all entities", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_05_01", + "doc": "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": [ + "046_05", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][name][value]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}' and\n Notification received The expression `'${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5'' should be True\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'airQualityLevel-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_05" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_06.json b/doc/files/ContextInformation/Subscription/046_06.json new file mode 100644 index 0000000000000000000000000000000000000000..7515099f85d259cb27253cf4c52fa35a53bf3f69 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_06.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_06", + "test_objective": "If a Subscription does not define a timeInterval member, the notification shall be sent whenever an entity matches the query defined in the subscription. 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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Setup Server And Subscriptions", + "Delete Server And Subscriptions" + ], + "teardown": "Delete Server And Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_06_01 Check that a notification is sent with all matching entities", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_06_01", + "doc": "only the subscribed Entities matching the query and watched attributes shall be included.", + "tags": [ + "046_06", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-location-attribute.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_07.json b/doc/files/ContextInformation/Subscription/046_07.json new file mode 100644 index 0000000000000000000000000000000000000000..e53a5a97e9ec20dcb66f74cc02e36ed51b3bfd24 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_07.json @@ -0,0 +1,72 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_07", + "test_objective": "Check that a notification is only sent if and only if the status is active", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 046.07.01", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_046_07_01", + "keywords": [ + "Before Suite", + "After Suite" + ], + "teardown": "After Suite", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Subscription ${subscription} \n with an id set to ${subscription_id} \n}", + "test_cases": [ + { + "name": "046_07_01 Check notification structure", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_07_01", + "doc": "The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above", + "tags": [ + "046_07_01", + "5_8_6", + "sub-notification" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "After Test", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "046_07_02 Check correct attributes are included", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_07_02", + "doc": "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": [ + "046_07_02", + "5_8_6", + "sub-notification" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "After Test", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received The dictionary `${notification}[data][0]' should contain the key 'airQualityLevel'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "046_07_03 Check URI expansion is observed", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_07_03", + "doc": "The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7).", + "tags": [ + "046_07_03", + "5_8_6", + "sub-notification" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "After Test", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received The dictionary `${notification}[data][0]' should contain the key 'https://ngsi-ld-test-suite/context#airQualityLevel'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_08.json b/doc/files/ContextInformation/Subscription/046_08.json new file mode 100644 index 0000000000000000000000000000000000000000..06213e443e7fe20b270da2df2e27966889addf10 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_08.json @@ -0,0 +1,55 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_08", + "test_objective": "Check that a notification is only sent if and only if the status is active", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Suite", + "After Suite" + ], + "teardown": "After Suite", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Subscription ${subscription} \n with an id set to ${subscription_id} \n}", + "test_cases": [ + { + "name": "046_08_01 Check that a notification is sent with all attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_08_01", + "doc": "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": [ + "046_08", + "5_8_6", + "sub-notification" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "After Test", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][name][value]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The dictionary `${notification}[data][0]' should contain the key 'almostFull' and\n Notification received The dictionary `${notification}[data][0]' should contain the key 'airQualityLevel' and\n Notification received The dictionary `${notification}[data][0]' should contain the key 'subCategory' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'airQualityLevel-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "046_08_02 Check that a notification is sent with all attributes in simplified format", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_08_02", + "doc": "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": [ + "046_08", + "5_8_6", + "sub-notification" + ], + "setup": "Setup Initial Subscriptions", + "teardown": "After Test", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '5' seconds and\n Notification received Notification data: '${notification}[subscriptionId]' equal to '${subscription_id}' and\n Notification received Notification data: '${notification}[data][0][id]' equal to '${entity_id}' and\n Notification received Notification data: '${notification}[data][0][name]' equal to 'Eiffel Tower' and\n Notification received The dictionary `${notification}' should contain the key 'data' and\n Notification received The variable `${notification}[data]' should not be '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'airQualityLevel-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_08" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_09.json b/doc/files/ContextInformation/Subscription/046_09.json new file mode 100644 index 0000000000000000000000000000000000000000..775f8e6d90e1dea71743bc49e7f3c6db54762c88 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_09.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_09", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_09_01 Check that a notification is sent to the endpoint", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_09_01", + "doc": "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": [ + "046_09", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds and\n Notification received The dictionary `${headers}' should contain the key 'X-Additional-Key'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_10.json b/doc/files/ContextInformation/Subscription/046_10.json new file mode 100644 index 0000000000000000000000000000000000000000..38c079e3e27cab15c3ce298ef0d0f837954499dd --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_10.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_10", + "test_objective": "The Notification content shall be JSON by default.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_10_01 Check that the notification is sent as JSON", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_10_01", + "doc": "The Notification shall be sent as JSON", + "tags": [ + "046_10", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_11.json b/doc/files/ContextInformation/Subscription/046_11.json new file mode 100644 index 0000000000000000000000000000000000000000..f279fb7355e140f371c76926906c674ce498f0d1 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_11.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_11", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_11_01 Check that timesSent is increased by one", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_11_01", + "doc": "The notification.timesSent member shall be incremented by one.", + "tags": [ + "046_11", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds and\n Notification received Notification data: '${response.json()}[notification][timesSent]' equal to '${1}' and\n Retrieve Subscription received The dictionary `${response.json()}[notification]' should contain the key 'timesSent'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${subscription_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_11" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_12.json b/doc/files/ContextInformation/Subscription/046_12.json new file mode 100644 index 0000000000000000000000000000000000000000..4649f01abb2c0d95668dab57cb4832431fbcf596 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_12.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_12", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_12_01 Check that lastNotification is updated", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_12_01", + "doc": "The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats.", + "tags": [ + "046_12", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '10' seconds and\n Notification received Notification data: '${notification_info}[0][status]' equal to 'ok' and\n Notification received The dictionary `${notification_info}[0]' should contain the key 'status' and\n Notification received The dictionary `${notification_info}[0]' should contain the key 'lastNotification' and\n Notification received The dictionary `${notification_info}[0]' should contain the key 'lastSuccess'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${subscription_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_12" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_13.json b/doc/files/ContextInformation/Subscription/046_13.json new file mode 100644 index 0000000000000000000000000000000000000000..9bed3792986626db11b4340ae7c6d331cfd69023 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_13.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_13", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_13_01 Check that lastFailure and status are updated if a notification could not be sent", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_13_01", + "doc": "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": [ + "046_13", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Notification data: '${notification_info}[0][status]' equal to 'failed' and\n Notification received The dictionary `${notification_info}[0]' should contain the key 'status' and\n Notification received The dictionary `${notification_info}[0]' should contain the key 'lastFailure'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Subscription Retrieve with the following data: and\n Query Parameter: id set to '${subscription_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_13" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Subscription/046_14.json b/doc/files/ContextInformation/Subscription/046_14.json new file mode 100644 index 0000000000000000000000000000000000000000..d2c1783ca2de4aad54af58f23836c29fc2c7ff62 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_14.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_14", + "test_objective": "The Notification content shall be JSON-LD when endpoint.accept is set to JSON-LD", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_8_6", + "keywords": [ + "Before Test", + "After Test" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_14_01 Check that a notification is sent as JSON-LD", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_14_01", + "doc": "The Notification content shall be JSON-LD when endpoint.accept is set to 'application/ld+json'", + "tags": [ + "046_14", + "5_8_6", + "sub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Notification with The dictionary `${notification}[data][0]' should contain the key '@context'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to '${fragment_filename}' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Subscription/SubscriptionNotificationBehaviour", + "robotfile": "046_14" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/036_01.json b/doc/files/ContextSource/Discovery/036_01.json new file mode 100644 index 0000000000000000000000000000000000000000..49f5e5c86dfca01bdf5e256844afb3710c61d172 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/036_01", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "036_01_01 Not Present Id", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_01_01", + "doc": "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", + "tags": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Context Source Registration With A Not Present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 400 and\n Retrieve Context Source Registration with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Context Source Registration with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + }, + { + "name": "036_01_02 Invalid Id", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_01_02", + "doc": "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", + "tags": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Context Source Registration With A Not Present Or Invalid Id", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 400 and\n Retrieve Context Source Registration with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Context Source Registration with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to 'invalidUri'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/RetrieveContextSourceRegistration", + "robotfile": "036_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/036_02.json b/doc/files/ContextSource/Discovery/036_02.json new file mode 100644 index 0000000000000000000000000000000000000000..dc9eb95c2003757c13a0ff775167aafb6fa95832 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/036_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_1", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "036_02_01 Retrieve Unknown Context Source Registration", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_02_01", + "doc": "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": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 404 and\n Retrieve Context Source Registration with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Context Source Registration with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to 'urn:ngsi-ld:ContextSourceRegistration:unknowRegistration'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/RetrieveContextSourceRegistration", + "robotfile": "036_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/036_03.json b/doc/files/ContextSource/Discovery/036_03.json new file mode 100644 index 0000000000000000000000000000000000000000..4f8ff537f17b94cb0435411ae1fdd8822a91ed9b --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/036_03", + "test_objective": "Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_1", + "keywords": [ + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "teardown": "Delete Created Context Source Registration", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "036_03_01 Retrieve Context Source Registration With Default Core Context", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_03_01", + "doc": "Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed.", + "tags": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 200 and\n Retrieve Context Source Registration with Response containing:\n * file set to 'csourceRegistrations/expectations/context-source-registration-expanded-format.json'\n * id set to '${context_source_registration_id}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to '${context_source_registration_id}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/RetrieveContextSourceRegistration", + "robotfile": "036_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/036_04.json b/doc/files/ContextSource/Discovery/036_04.json new file mode 100644 index 0000000000000000000000000000000000000000..9811eb1afe7b2372c24920896b91f05069413565 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/036_04", + "test_objective": "Check that you can retrieve a Context Source Registration", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_1", + "keywords": [ + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "teardown": "Delete Created Context Source Registration", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "036_04_01 Retrieve Context Source Registration", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_04_01", + "doc": "Check that you can retrieve a Context Source Registration", + "tags": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 200 and\n Retrieve Context Source Registration with Response containing:\n * file set to 'csourceRegistrations/expectations/context-source-registration.json'\n * id set to '${context_source_registration_id}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to '${context_source_registration_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/RetrieveContextSourceRegistration", + "robotfile": "036_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/036_05.json b/doc/files/ContextSource/Discovery/036_05.json new file mode 100644 index 0000000000000000000000000000000000000000..e8f342b8518eb593cd87217c6366e4c41d827b87 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_05.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/036_05", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "036_05_01 EmptyJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_05_01", + "doc": "Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present", + "tags": [ + "6_3_5", + "csr-retrieve" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Review JSON-LD resolution when retrieving a context source registration", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 200 and\n Retrieve Context Source Registration with Response containing:\n * file set to 'csourceRegistrations/expectations/context-source-registration-expanded-format.json'\n * id set to '${context_source_registration_id}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to '${context_source_registration_id}' and\n Query Parameter: context set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + }, + { + "name": "036_05_02 CreationTimeJsonLdContext", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/036_05_02", + "doc": "Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present", + "tags": [ + "6_3_5", + "csr-retrieve" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Review JSON-LD resolution when retrieving a context source registration", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration with Response Status Code set to 200 and\n Retrieve Context Source Registration with Response containing:\n * file set to 'csourceRegistrations/expectations/context-source-registration.json'\n * id set to '${context_source_registration_id}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'GET'\n Retrieve Context Source Registration with data: and\n Query Parameter: context source registration id set to '${context_source_registration_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextSource/Discovery/RetrieveContextSourceRegistration", + "robotfile": "036_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_01.json b/doc/files/ContextSource/Discovery/037_01.json new file mode 100644 index 0000000000000000000000000000000000000000..4d8e4d537f9a021e70f362bd27271ab00758ff01 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_01.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_01", + "test_objective": "Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities\n}", + "test_cases": [ + { + "name": "037_01_01 With list of entity types", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_01_01", + "doc": "Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query A Context Source Registration", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_01_02 With list of attribute names", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_01_02", + "doc": "Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query A Context Source Registration", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: attrs set to 'name'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_02.json b/doc/files/ContextSource/Discovery/037_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a9b34f0669c24d502434eb05200aa3b35b437c33 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_02", + "test_objective": "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.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_02_01 Query Context Source Registrations Without Entity Types and Attribute Names", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_02_01", + "doc": "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": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 400 and\n Query Context Source Registrations with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registrations with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_03.json b/doc/files/ContextSource/Discovery/037_03.json new file mode 100644 index 0000000000000000000000000000000000000000..0195af8be49e9f779c64768100573bbd36a08b75 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_03.json @@ -0,0 +1,82 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_03", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_03_01 Invalid URI", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_03_01", + "doc": "Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration With Invalid Query Param", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 400 and\n Query Context Source Registrations with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registrations with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: id set to 'invalidUri'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_03_02 Invalid Query", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_03_02", + "doc": "Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration With Invalid Query Param", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 400 and\n Query Context Source Registrations with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registrations with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: q set to 'invalidQuery'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_03_03 Invalid GeoQuery", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_03_03", + "doc": "Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration With Invalid Query Param", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 400 and\n Query Context Source Registrations with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registrations with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: georel set to 'within'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_03_04 Invalid Temporal Query", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_03_04", + "doc": "Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration With Invalid Query Param", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 400 and\n Query Context Source Registrations with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registrations with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: timerel set to 'before'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_04.json b/doc/files/ContextSource/Discovery/037_04.json new file mode 100644 index 0000000000000000000000000000000000000000..4754e8bade0d574f5ef1b1c43228f36b915ccee1 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_04", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [ + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "teardown": "Delete Created Context Source Registration", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_04_01 Query Context Source Registrations Without Context", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_04_01", + "doc": "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": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${context_source_registration_id}' and\n Query Parameter: type set to 'https://ngsi-ld-test-suite/context#Building'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_05.json b/doc/files/ContextSource/Discovery/037_05.json new file mode 100644 index 0000000000000000000000000000000000000000..f62b402bc16509d5f40b95071062aaf8cfe4ba78 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_05.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_05", + "test_objective": "Check that you can query context source registrations matching EntityInfo of RegistrationInfo", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_05_01 Registration With EntityInfo Matching The Query", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_05_01", + "doc": "Check that you can query context source registrations matching EntityInfo of RegistrationInfo", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching EntityInfo of RegistrationInfo", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Vehicle' and\n Query Parameter: attrs set to 'name'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_05_02 Registration Without EntityInfo", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_05_02", + "doc": "Check that you can query context source registrations matching EntityInfo of RegistrationInfo", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching EntityInfo of RegistrationInfo", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Vehicle' and\n Query Parameter: attrs set to 'name'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_06.json b/doc/files/ContextSource/Discovery/037_06.json new file mode 100644 index 0000000000000000000000000000000000000000..db192f062dc2ea8ece5b0652ec79c5c6ef180757 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_06.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_06", + "test_objective": "Check that you can query context source registrations matching property and relationship names of RegistrationInfo", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "037_06_01 Query With Matching Properties And Relationships", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_06_01", + "doc": "Check that you can query context source registrations matching property and relationship names of RegistrationInfo", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: attrs set to 'name,locatedAt'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_06_02 Query Without Properties And Relationships", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_06_02", + "doc": "Check that you can query context source registrations matching property and relationship names of RegistrationInfo", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: attrs set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_06" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_07.json b/doc/files/ContextSource/Discovery/037_07.json new file mode 100644 index 0000000000000000000000000000000000000000..88fd67790667d856f9dc76f252f2716092e8a8f6 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_07.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_07", + "test_objective": "Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "037_07_01 Near Point", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_07_01", + "doc": "Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching Geoquery", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: georel set to '${georel}' and\n Query Parameter: geometry set to '${geometry}' and\n Query Parameter: coordinates set to '${coordinates}' and\n Query Parameter: geoproperty set to '${geoproperty}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_07_02 Within Polygon", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_07_02", + "doc": "Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registration", + "teardown": "Delete Created Context Source Registration", + "template": "Query Context Source Registration Matching Geoquery", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: georel set to '${georel}' and\n Query Parameter: geometry set to '${geometry}' and\n Query Parameter: coordinates set to '${coordinates}' and\n Query Parameter: geoproperty set to '${geoproperty}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_07" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_08.json b/doc/files/ContextSource/Discovery/037_08.json new file mode 100644 index 0000000000000000000000000000000000000000..19a948bacb4fd87173be413587b7096936079e68 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_08.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [ + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "teardown": "Delete Created Context Source Registration", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_08_01 Query Context Source Registration Without Temporal Query", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_08_01", + "doc": "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": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Vehicle'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_08" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_09.json b/doc/files/ContextSource/Discovery/037_09.json new file mode 100644 index 0000000000000000000000000000000000000000..877ab8d76b1793b302cea42636666e8fabdc35ff --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_09.json @@ -0,0 +1,84 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_09", + "test_objective": "Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "037_09_01 Observation Interval With observedAt", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_09_01", + "doc": "Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Matching Temporal Query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: timeproperty set to 'observedAt' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2021-08-01T22:00:00Z'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_09_02 Observation Interval Without timeproperty", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_09_02", + "doc": "Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Matching Temporal Query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: timeproperty set to '${EMPTY}' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2021-08-01T22:00:00Z'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_09_03 Management Interval With createdAt", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_09_03", + "doc": "Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Matching Temporal Query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: timeproperty set to 'createdAt' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2021-08-01T22:00:00Z'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_09_04 Management Interval With modifiedAt", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_09_04", + "doc": "Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Matching Temporal Query", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: timeproperty set to 'modifiedAt' and\n Query Parameter: timerel set to 'before' and\n Query Parameter: timeAt set to '2021-08-01T22:00:00Z'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_09" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_10.json b/doc/files/ContextSource/Discovery/037_10.json new file mode 100644 index 0000000000000000000000000000000000000000..c69a616db5e296031a3a2402193ffb807bd66a67 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_10.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_10", + "test_objective": "Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities\n}", + "test_cases": [ + { + "name": "037_10_01 With list of Entity Ids", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_10_01", + "doc": "Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: id set to '${first_context_source_registration_id},${third_context_source_registration_id}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_10_02 With NGSI-LD Query", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_10_02", + "doc": "Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: q set to 'location.type==\"GeoProperty\"'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_10_03 With Context Source Filter", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_10_03", + "doc": "Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Notification with Response body set to list of all matching Context Source Registrations resolved against the default JSON-LD context\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: csf set to 'endpoint==\"http://my.csource.org:1026\"'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_10" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Discovery/037_11.json b/doc/files/ContextSource/Discovery/037_11.json new file mode 100644 index 0000000000000000000000000000000000000000..384058b82fddbe3b010ce6bd0ef1b23417ac5f53 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_11.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CS/DISC/037_11", + "test_objective": "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.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_10_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities\n}", + "test_cases": [ + { + "name": "037_11_01 Query Second Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_11_01", + "doc": "Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9.", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Query Context Source Registrations with Response Body containing a list of entities equal to '${1}' of type 'ContextSourceRegistration' with response set to '${response.json()}' and\n Query Context Source Registrations with Response header with 'Prev' header equal to ';rel=\"next\";type=\"application/ld+json\"' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: limit set to '${1}' and\n Query Parameter: page set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_11_02 Query Last Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_11_02", + "doc": "Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9.", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Query Context Source Registrations with Response Body containing a list of entities equal to '${1}' of type 'ContextSourceRegistration' with response set to '${response.json()}' and\n Query Context Source Registrations with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: limit set to '${2}' and\n Query Parameter: page set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "037_11_03 Query All Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CS/DISC/037_11_03", + "doc": "Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9.", + "tags": [ + "5_10_2", + "csr-query" + ], + "setup": "Setup Initial Context Source Registrations", + "teardown": "Delete Created Context Source Registrations", + "template": "Query Context Source Registration With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registrations with Response Status Code set to 200 and\n Query Context Source Registrations with Response Body containing a list of entities equal to '${3}' of type 'ContextSourceRegistration' with response set to '${response.json()}' and\n Query Context Source Registrations with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: type set to 'Building' and\n Query Parameter: limit set to '${15}' and\n Query Parameter: page set to '${1}'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextSource/Discovery/QueryContextSourceRegistrations", + "robotfile": "037_11" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_01_01.json b/doc/files/ContextSource/Registration/033_01_01.json new file mode 100644 index 0000000000000000000000000000000000000000..33a0b6d13d322e3cc53c535417f72c7d766f16d3 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_01_01", + "test_objective": "Check that you can create a context source registration with specific ID and expiration date", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_2", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_01_01 Create Context Source Registration With Specific Date Expiration Date", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_01", + "doc": "Check that you can create a context source registration with specific ID and expiration date", + "tags": [ + "5_9_2", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_01_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_01_02.json b/doc/files/ContextSource/Registration/033_01_02.json new file mode 100644 index 0000000000000000000000000000000000000000..392a2a7be6cf02aed8e2e0a386a6b625d2fa7987 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_01_02", + "test_objective": "Check that you can create a context source registration that never expires", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_2", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_01_02 Create Context Source Registration That Never Expires", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_02", + "doc": "Check that you can create a context source registration that never expires", + "tags": [ + "5_9_2", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Create Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_01_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_01_03.json b/doc/files/ContextSource/Registration/033_01_03.json new file mode 100644 index 0000000000000000000000000000000000000000..9d1c4a825c842d5463e0141ad773ac9f1b7fdfa0 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_01_03", + "test_objective": "Check that you can create a context source registration without specifying an ID", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_2", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_01_03 Create Context Source Registration Without A Sprecified ID", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_03", + "doc": "Check that you can create a context source registration without specifying an ID", + "tags": [ + "5_9_2", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_01_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_02.json b/doc/files/ContextSource/Registration/033_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a5459bf2647af46d7fa5e48d5af4c482734c0c18 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_02", + "test_objective": "Check that you cannot create a context source with invalid content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "033_02_01 Create a context source registration with invalid JSON file", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_02_01", + "doc": "Create a context source registration with invalid JSON file", + "tags": [ + "5_9_2", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration with Response Status Code set to 400 and\n Create Context Source Registration with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${subscription_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_03.json b/doc/files/ContextSource/Registration/033_03.json new file mode 100644 index 0000000000000000000000000000000000000000..5833d7e18f7df7f3d82bafff21f8ddb6c296f0bb --- /dev/null +++ b/doc/files/ContextSource/Registration/033_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_03", + "test_objective": "Check that you cannot create a context source registration that already exists", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "033_03_01 Create a context source registration that already exists", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_03_01", + "doc": "Check that you cannot create a context source registration that already exists", + "tags": [ + "5_9_2", + "csr-create" + ], + "setup": "Create New Context Source Registration", + "teardown": "Delete Created Context Source Registrations", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 409 and\n Create Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_04.json b/doc/files/ContextSource/Registration/033_04.json new file mode 100644 index 0000000000000000000000000000000000000000..a2682f506038d765be7a19545aa748e1ec12a9a6 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_04.json @@ -0,0 +1,52 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_04", + "test_objective": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_04_01 Create one context source registration using a provided Link header with JSON content type with Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_04_01", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + }, + { + "name": "033_04_02 Create one context source registration using a provided Link header with JSON content type without Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_04_02", + "doc": "Check that the @context is obtained from a Link Header if the Content-Type header is \"application/json\"", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'https://ngsi-ld-test-suite/context#Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_05.json b/doc/files/ContextSource/Registration/033_05.json new file mode 100644 index 0000000000000000000000000000000000000000..c014ff07f456bc04960324b3946b5458c9b3949e --- /dev/null +++ b/doc/files/ContextSource/Registration/033_05.json @@ -0,0 +1,52 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_05", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_05_01 Create one context source registration using the default context with JSON content type with Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_05_01", + "doc": "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 and retrieve the information with ngsild context", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'ngsi-ld:default-context/Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + }, + { + "name": "033_05_02 Create one context source registration using the default context with JSON content type without Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_05_02", + "doc": "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 and retrieve the information without ngsild context", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_06.json b/doc/files/ContextSource/Registration/033_06.json new file mode 100644 index 0000000000000000000000000000000000000000..efe3afac209c45bcb46ded12a1cdd968033defc0 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_06.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_06", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_06_01 Create one context source registration containing a JSON-LD @context with a JSON content type", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_06_01", + "doc": "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": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 400 and\n Create Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_06" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_07.json b/doc/files/ContextSource/Registration/033_07.json new file mode 100644 index 0000000000000000000000000000000000000000..e35f51aba09fb89725ac44f6025508427bee29ae --- /dev/null +++ b/doc/files/ContextSource/Registration/033_07.json @@ -0,0 +1,52 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_07", + "test_objective": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [ + "Delete Created Context Source Registrations" + ], + "teardown": "Delete Created Context Source Registrations", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_07_01 Create one context source registration using a JSON-LD @context obtained from the request payload with Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_07_01", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and retrieve the information with ngsild context", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + }, + { + "name": "033_07_02 Create one context source registration using a JSON-LD @context obtained from the request payload without Context", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_07_02", + "doc": "Check that the @context is obtained from the request payload body itself if the Content-Type header is \"application/ld+json\" and retrieve the information without ngsild context", + "tags": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Response Body containing the key '['information'][0]['entities'][0]['type']', with the value 'https://ngsi-ld-test-suite/context#Building'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "then" + ], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_07" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_08.json b/doc/files/ContextSource/Registration/033_08.json new file mode 100644 index 0000000000000000000000000000000000000000..fc7ebe78aa6da084b59a82a7beebcf89d8c534ce --- /dev/null +++ b/doc/files/ContextSource/Registration/033_08.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_08_01 Create one context source registration not containing a JSON-LD @context with a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_08_01", + "doc": "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": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 400 and\n Create Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_08" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_09.json b/doc/files/ContextSource/Registration/033_09.json new file mode 100644 index 0000000000000000000000000000000000000000..76aa11cb425471ca84c197af06b454965a628ec2 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_09.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_09", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_09_01 Create one context source registration with a Link header and a JSON-LD content type", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_09_01", + "doc": "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": [ + "6_3_5", + "csr-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 400 and\n Create Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_09" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/033_10.json b/doc/files/ContextSource/Registration/033_10.json new file mode 100644 index 0000000000000000000000000000000000000000..7e0c7b69a32c2dc5731eb5a7a1e0b57c58870831 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_10.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/CSR/033_10", + "test_objective": "Check that you cannot create a context source with invalid content", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "033_10_01 Create a context source registration with a different data structure than CsourRegistration data type", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_10_01", + "doc": "Check that you cannot create a context source with invalid content", + "tags": [ + "csr-create", + "6_3_5" + ], + "setup": null, + "teardown": null, + "template": "Create Context Source With Invalid Content", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 400 and\n Create Context Source Registration With Return with Response Header: Location containing $${registration_id}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + }, + { + "name": "033_10_02 Create a context source registration with a date in the past", + "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_10_02", + "doc": "Check that you cannot create a context source with invalid content", + "tags": [ + "csr-create", + "6_3_5" + ], + "setup": null, + "teardown": null, + "template": "Create Context Source With Invalid Content", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 400 and\n Create Context Source Registration With Return with Response Header: Location containing $${registration_id}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${updated_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/RegisterContextSource", + "robotfile": "033_10" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/034_01.json b/doc/files/ContextSource/Registration/034_01.json new file mode 100644 index 0000000000000000000000000000000000000000..423e9857d85831912394323f88d6efdd08b72f5e --- /dev/null +++ b/doc/files/ContextSource/Registration/034_01.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_01", + "test_objective": "Check that you can update a context source registration by id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "034_01_01 Update a context source registration by id", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_01_01", + "doc": "Check that you can update a context source registration by id", + "tags": [ + "5_9_3", + "csr-update" + ], + "setup": "Initialize the Test Case", + "teardown": "Delete Updated Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 204 and\n Notification with Check Retrieving Context Source Registration and\n Query Parameter: registration_id set to 'registration_id=${registration_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: accept set to 'accept=${CONTENT_TYPE_LD_JSON}' and\n Query Parameter: registration_payload set to 'registration_payload=${registration_payload}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${registration_update_fragment}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + }, + { + "name": "034_01_02 Update a context source registration to never expire", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_01_02", + "doc": "Check that you can update a context source registration by id", + "tags": [ + "5_9_3", + "csr-update" + ], + "setup": "Initialize the Test Case", + "teardown": "Delete Updated Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 204 and\n Notification with Check Retrieving Context Source Registration and\n Query Parameter: registration_id set to 'registration_id=${registration_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: accept set to 'accept=${CONTENT_TYPE_LD_JSON}' and\n Query Parameter: registration_payload set to 'registration_payload=${registration_payload}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${registration_update_fragment}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/UpdateContextSourceRegistration", + "robotfile": "034_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/034_02.json b/doc/files/ContextSource/Registration/034_02.json new file mode 100644 index 0000000000000000000000000000000000000000..48204c12d6b69afe78101db0acb1170c8fd11f40 --- /dev/null +++ b/doc/files/ContextSource/Registration/034_02.json @@ -0,0 +1,80 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_02", + "test_objective": "Check that you cannot update a context source registration under some conditions", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "034_02_01 Update a context source registration by id if the Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_02_01", + "doc": "Check that you cannot update a context source registration under some conditions", + "tags": [ + "csr-update", + "5_9_3" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Initial Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 400 and\n Update Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${fragment_with_id}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + }, + { + "name": "034_02_02 Update a context source registration by id if the Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_02_02", + "doc": "Check that you cannot update a context source registration under some conditions", + "tags": [ + "csr-update", + "5_9_3" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Initial Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 400 and\n Update Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${fragment_with_id}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + }, + { + "name": "034_02_03 Update a context source registration if the request body is not of the same data type", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_02_03", + "doc": "Check that you cannot update a context source registration under some conditions", + "tags": [ + "csr-update", + "5_9_3" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Initial Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 400 and\n Update Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${fragment_with_id}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + }, + { + "name": "034_02_04 Update a context source registration if you attempt to remove a mandatory property", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_02_04", + "doc": "Check that you cannot update a context source registration under some conditions", + "tags": [ + "csr-update", + "5_9_3" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Initial Context Source Registration", + "template": "Update A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 400 and\n Update Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${fragment_with_id}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/UpdateContextSourceRegistration", + "robotfile": "034_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/034_03.json b/doc/files/ContextSource/Registration/034_03.json new file mode 100644 index 0000000000000000000000000000000000000000..470b47104862bb06fa79ba808c776a519163aded --- /dev/null +++ b/doc/files/ContextSource/Registration/034_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_03", + "test_objective": "Check that you cannot update a context source registration by id if the id is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "034_03_01 Update a context source registration by id if the id is not known to the system", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_03_01", + "doc": "Check that you cannot update a context source registration by id if the id is not known to the system", + "tags": [ + "5_9_3", + "csr-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration With Return with Response Status Code set to 404 and\n Update Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with id set to '${registration_id}' and registration update fragment set to '${fragment_with_id}' and content-type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/UpdateContextSourceRegistration", + "robotfile": "034_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/034_04.json b/doc/files/ContextSource/Registration/034_04.json new file mode 100644 index 0000000000000000000000000000000000000000..7214cfdb425966a43ae291d0f0417fe96912994a --- /dev/null +++ b/doc/files/ContextSource/Registration/034_04.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_04", + "test_objective": "Check that you cannot update a context source registration under some conditions", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "034_04_01 Update a context source registration if the request body is invalid", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_04_01", + "doc": "Check that you cannot update a context source registration if the request body is invalid", + "tags": [ + "5_9_3", + "csr-update" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Initial Context Source Registration", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration with Response Status Code set to 400 and\n Update Context Source Registration with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Context Source Registration with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with CSR Id set to '${registration_id}' and subscription update fragment set to 'context-source-registration-invalid-sample.jsonld'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/UpdateContextSourceRegistration", + "robotfile": "034_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/035_01.json b/doc/files/ContextSource/Registration/035_01.json new file mode 100644 index 0000000000000000000000000000000000000000..0150352459c9a402f23a99490c41aa90fcba992e --- /dev/null +++ b/doc/files/ContextSource/Registration/035_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/035_01", + "test_objective": "Check that you can delete a context source registration by id", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "035_01_01 Delete a context source registration by id", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/035_01_01", + "doc": "Check that you can delete a context source registration by id", + "tags": [ + "5_9_4", + "csr-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Delete Context Source Registration With Return with Response Status Code set to 204 and\n Retrieve Context Source Registration with Response Status Code set to ${response1.status_code}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Delete Context Source Registration with id set to '${registration_id}'\n}", + "http_verb": "DELETE", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/DeleteContextSourceRegistration", + "robotfile": "035_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/035_02.json b/doc/files/ContextSource/Registration/035_02.json new file mode 100644 index 0000000000000000000000000000000000000000..b9e1974433d619d562cc50870aab981058fe5cda --- /dev/null +++ b/doc/files/ContextSource/Registration/035_02.json @@ -0,0 +1,50 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/035_02", + "test_objective": "Check that you cannot delete a context source registration under some conditions", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "test_cases": [ + { + "name": "035_02_01 Delete a Context Source Registration if the Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/035_02_01", + "doc": "Check that you cannot delete a context source registration under some conditions", + "tags": [ + "5_9_4", + "csr-delete" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Created Context Source Registrations", + "template": "Delete A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 400 and\n Delete Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Delete Context Source Registration with id set to '${EMPTY}'\n}", + "http_verb": "DELETE", + "endpoint": "csourceRegistrations/{registration_id}" + }, + { + "name": "035_02_02 Delete a Context Source Registration if the Id is not a valid URI", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/035_02_02", + "doc": "Check that you cannot delete a context source registration under some conditions", + "tags": [ + "5_9_4", + "csr-delete" + ], + "setup": "Create Initial Context Source Registration", + "teardown": "Delete Created Context Source Registrations", + "template": "Delete A Context Source", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 400 and\n Delete Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Delete Context Source Registration with id set to 'invalidURI'\n}", + "http_verb": "DELETE", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/Registration/DeleteContextSourceRegistration", + "robotfile": "035_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/035_03.json b/doc/files/ContextSource/Registration/035_03.json new file mode 100644 index 0000000000000000000000000000000000000000..9baafe82de60e64612ee005482612bf7d9e326d4 --- /dev/null +++ b/doc/files/ContextSource/Registration/035_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/035_03", + "test_objective": "Check that you cannot delete a context source registration by id if the id is not known to the system", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_9_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "035_03_01 Delete a context source registration by id", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/035_03_01", + "doc": "Check that you cannot delete a context source registration by id if the id is not known to the system", + "tags": [ + "5_9_4", + "csr-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 404 and\n Delete Context Source Registration With Return with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Delete Context Source Registration with id set to '${registration_id}'\n}", + "http_verb": "DELETE", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/DeleteContextSourceRegistration", + "robotfile": "035_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_01.json b/doc/files/ContextSource/RegistrationSubscription/038_01.json new file mode 100644 index 0000000000000000000000000000000000000000..cfc50ee45eff5d484ca684cfc839c4d56895226b --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_01", + "test_objective": "Check that you can create a minimal context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Generate Random Ids For Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_01_01 Create Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_01_01", + "doc": "Check that you can create a minimal context source registration subscription", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_02.json b/doc/files/ContextSource/RegistrationSubscription/038_02.json new file mode 100644 index 0000000000000000000000000000000000000000..81ecf1fe360ae883786de25d3d46df64a0381ac1 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_02", + "test_objective": "Check that you can create a context source registration subscription without providing an id and it will be automatically generated", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_02_01 Create Context Source Registration Subscription Without An Id", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_02_01", + "doc": "Check that you can create a context source registration subscription without providing an id and it will be automatically generated", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_03.json b/doc/files/ContextSource/RegistrationSubscription/038_03.json new file mode 100644 index 0000000000000000000000000000000000000000..9c380e0aa5f3cd880cb5c8497e3f233b026224ff --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_03.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_03", + "test_objective": "Check that you can create a context source registration subscription without providing isActive member and will be active by default", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Generate Random Ids For Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_03_01 Create Context Source Registration Subscription Without isActive Member", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_03_01", + "doc": "Check that you can create a context source registration subscription without providing isActive member and will be active by default", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'active'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_04.json b/doc/files/ContextSource/RegistrationSubscription/038_04.json new file mode 100644 index 0000000000000000000000000000000000000000..9a536274231fb0d6a76de3e3d632081ea2a5744f --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_04.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_04", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Generate Random Ids For Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_04_01 Create Inactive Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_04_01", + "doc": "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": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'paused'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_05.json b/doc/files/ContextSource/RegistrationSubscription/038_05.json new file mode 100644 index 0000000000000000000000000000000000000000..eddf9725ad365454bb1780aa108189ce65ecab65 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_05.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_05", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Generate Random Ids For Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_05_01 Create Context Source Registration Subscription With expiresAt Member", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_05_01", + "doc": "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": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'expired'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_06.json b/doc/files/ContextSource/RegistrationSubscription/038_06.json new file mode 100644 index 0000000000000000000000000000000000000000..8c5bcff02353231b880c994f9f0a4f57596c88e4 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_06.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_06", + "test_objective": "Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [ + "Generate Random Ids For Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "teardown": "Delete Created Context Source Registration Subscriptions", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_06_01 Create Context Source Registration Subscription Without expiresAt Member", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_06_01", + "doc": "Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Response Body containing an Attribute set to and\n Query Parameter: expected_attribute_name set to 'status' and\n Query Parameter: response_body set to 'response1.json()' and\n Query Parameter: expected_attribute_value set to 'active'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_06" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_07.json b/doc/files/ContextSource/RegistrationSubscription/038_07.json new file mode 100644 index 0000000000000000000000000000000000000000..dde1a2c58b9a061207a3784d9a2074cb306be649 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_07.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_07", + "test_objective": "Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "038_07_01 Create Existing Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_07_01", + "doc": "Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Initial Context Source Registration Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 409 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_07" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_08.json b/doc/files/ContextSource/RegistrationSubscription/038_08.json new file mode 100644 index 0000000000000000000000000000000000000000..037ccaed424bfe50235e2ea21738ba407466e1d9 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_08.json @@ -0,0 +1,80 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_08_01 WithoutNotification", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_08_01", + "doc": "Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": "Create Invalid Context Source Registration Subscription", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 400 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + }, + { + "name": "038_08_02 InvalidType", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_08_02", + "doc": "Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": "Create Invalid Context Source Registration Subscription", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 400 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + }, + { + "name": "038_08_03 InvalidQuery", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_08_03", + "doc": "Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": "Create Invalid Context Source Registration Subscription", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 400 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + }, + { + "name": "038_08_04 EmptyWatchedAttributes", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_08_04", + "doc": "Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": "Create Invalid Context Source Registration Subscription", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 400 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_08" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/038_09.json b/doc/files/ContextSource/RegistrationSubscription/038_09.json new file mode 100644 index 0000000000000000000000000000000000000000..de06ab75d489ca3f99d120f2a91dfefba4a23936 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_09.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/038_09", + "test_objective": "Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_2", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "038_09_01 Create Expired Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/038_09_01", + "doc": "Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time", + "tags": [ + "5_11_2", + "csrsub-create" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 400 and\n Create Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Create Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription", + "robotfile": "038_09" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/039_01.json b/doc/files/ContextSource/RegistrationSubscription/039_01.json new file mode 100644 index 0000000000000000000000000000000000000000..59fccbe155476ae86cb49147eb937099354d9d97 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/039_01", + "test_objective": "Check that you can update a context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "039_01_01 Update Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_01_01", + "doc": "Check that you can update a context source registration subscription", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Initial Context Source Registration Subscriptions", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 204 and\n Retrieve Context Source Registration Subscription with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription", + "robotfile": "039_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/039_02.json b/doc/files/ContextSource/RegistrationSubscription/039_02.json new file mode 100644 index 0000000000000000000000000000000000000000..f7a3f19e22f39fd11845acadc27095c6835f6d55 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/039_02", + "test_objective": "Check that you cannot update a context source registration subscription with an invalid URI", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "039_02_01 Update Context Source Registration Subscription With Invalid Uri", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_02_01", + "doc": "Check that you cannot update a context source registration subscription with an invalid URI", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 400 and\n Update Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to 'invalidUri' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription", + "robotfile": "039_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/039_03.json b/doc/files/ContextSource/RegistrationSubscription/039_03.json new file mode 100644 index 0000000000000000000000000000000000000000..6f6d074dd25d7d7363d2a581d12441b539738d23 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/039_03", + "test_objective": "Check that you cannot update an unknown context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "039_03_01 Update Unknown Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_03_01", + "doc": "Check that you cannot update an unknown context source registration subscription", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 404 and\n Update Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Update Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to 'urn:ngsi-ld:Subscription:unknowSubscription' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription", + "robotfile": "039_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/039_04.json b/doc/files/ContextSource/RegistrationSubscription/039_04.json new file mode 100644 index 0000000000000000000000000000000000000000..78f3d36af1edbc88b28a6eaadceafb1ec75570a9 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_04.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/039_04", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "039_04_01 InvalidType", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_04_01", + "doc": "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", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Initial Context Source Registration Subscriptions", + "template": "Update Context Source Registration Subscription With Invalid Fragment", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 400 and\n Update Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + }, + { + "name": "039_04_02 InvalidNotification", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_04_02", + "doc": "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", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Initial Context Source Registration Subscriptions", + "template": "Update Context Source Registration Subscription With Invalid Fragment", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 400 and\n Update Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription", + "robotfile": "039_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/039_05.json b/doc/files/ContextSource/RegistrationSubscription/039_05.json new file mode 100644 index 0000000000000000000000000000000000000000..fb7b573661160ebc41967855338b39be3050755a --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_05.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/039_05", + "test_objective": "Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document)", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.3", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_3", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "039_05_01 Update Context Source Registration Subscription With Invalid JSON Fragment", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/039_05_01", + "doc": "Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document)", + "tags": [ + "5_11_3", + "csrsub-update" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Initial Context Source Registration Subscriptions", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription From File with Response Status Code set to 400 and\n Update Context Source Registration Subscription From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and\n Update Context Source Registration Subscription From File with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription from file with subscription id set to '${subscription_id}' and subscription update fragment set to 'csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription", + "robotfile": "039_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/040_01.json b/doc/files/ContextSource/RegistrationSubscription/040_01.json new file mode 100644 index 0000000000000000000000000000000000000000..24590fa0784d0c9ed687354568de66b9544efe85 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/040_01", + "test_objective": "Check that you can retrieve a context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "040_01_01 Retrieve Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/040_01_01", + "doc": "Check that you can retrieve a context source registration subscription", + "tags": [ + "5_11_4", + "csrsub-retrieve" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration Subscription with Response Status Code set to 200 and\n Retrieve Context Source Registration Subscription with Response Body containing the same content defined in file 'csourceSubscriptions/expectations/subscriptions-040-01-expectation.json' with subscription id '${subscription_id}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to '${subscription_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription", + "robotfile": "040_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/040_02.json b/doc/files/ContextSource/RegistrationSubscription/040_02.json new file mode 100644 index 0000000000000000000000000000000000000000..df3b3f487740e1f6065fa27998c68f01ad0e16d3 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/040_02", + "test_objective": "Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "040_02_01 Retrieve Context Source Registration Subscription With An Invalid Id", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/040_02_01", + "doc": "Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised", + "tags": [ + "5_11_4", + "csrsub-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration Subscription with Response Status Code set to 400 and\n Retrieve Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Retrieve Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to 'invalidUri'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription", + "robotfile": "040_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/040_03.json b/doc/files/ContextSource/RegistrationSubscription/040_03.json new file mode 100644 index 0000000000000000000000000000000000000000..cf401ddaa6d7f59ba5c549e282be759f18df73bd --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/040_03", + "test_objective": "Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "040_03_01 Retrieve Unknown Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/040_03_01", + "doc": "Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised", + "tags": [ + "5_11_4", + "csrsub-retrieve" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration Subscription with Response Status Code set to 404 and\n Retrieve Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Retrieve Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to 'urn:ngsi-ld:Subscription:unknowSubscription'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription", + "robotfile": "040_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/041_01.json b/doc/files/ContextSource/RegistrationSubscription/041_01.json new file mode 100644 index 0000000000000000000000000000000000000000..c18b4d80e4a2013c84c52c0bb81a39475a0fc064 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/041_01", + "test_objective": "Check that you can query context source registration subscriptions", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "041_01_01 Query Context Source Registration Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_01_01", + "doc": "Check that you can query context source registration subscriptions", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response containing:\n * file set to 'csourceSubscriptions/expectations/subscriptions-035-01-expectation.json'\n * id set to '${subscription_ids}'\n * response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions", + "robotfile": "041_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/041_02.json b/doc/files/ContextSource/RegistrationSubscription/041_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a652f73d4aaa8deaaa4b1185a25fcab345d164f4 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_02.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/041_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "041_02_01 Query One Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_02_01", + "doc": "Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit Parameter", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${1}' of type 'Subscription' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${1}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_02_02 Query Two Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_02_02", + "doc": "Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit Parameter", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${2}' of type 'Subscription' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_02_03 Query All Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_02_03", + "doc": "Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit Parameter", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${3}' of type 'Subscription' with response set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${15}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions", + "robotfile": "041_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/041_03.json b/doc/files/ContextSource/RegistrationSubscription/041_03.json new file mode 100644 index 0000000000000000000000000000000000000000..d3b63f7ae5e49aae489225c9e7400d261081949e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_03.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/041_03", + "test_objective": "Check that you can query context source registration subscriptions with providing page and limit parameters for pagination", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a set of Context Source Registration Subscriptions (CSRSs)\n}", + "test_cases": [ + { + "name": "041_03_01 Query Second Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_03_01", + "doc": "Check that you can query context source registration subscriptions with providing page and limit parameters for pagination", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${1}' of type 'Subscription' with response set to '${response.json()}' and\n Query Context Source Registration Subscriptions with Response header with 'Prev' header equal to ';rel=\"next\";type=\"application/ld+json\"' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${1}' and\n Query Parameter: page set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_03_02 Query Last Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_03_02", + "doc": "Check that you can query context source registration subscriptions with providing page and limit parameters for pagination", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${1}' of type 'Subscription' with response set to '${response.json()}' and\n Query Context Source Registration Subscriptions with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${2}' and\n Query Parameter: page set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_03_03 Query All Subscriptions", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_03_03", + "doc": "Check that you can query context source registration subscriptions with providing page and limit parameters for pagination", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": "Setup Initial Context Source Registration Subscriptions", + "teardown": "Delete Created Context Source Registration Subscriptions", + "template": "Query Context Source Registration Subscriptions With Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 200 and\n Query Context Source Registration Subscriptions with Response Body containing a list of entities equal to '${3}' of type 'Subscription' with response set to '${response.json()}' and\n Query Context Source Registration Subscriptions with Response header with 'Prev' header equal to '${EMPTY}' and with 'Next' header equal to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: limit set to '${15}' and\n Query Parameter: page set to '${1}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions", + "robotfile": "041_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/041_04.json b/doc/files/ContextSource/RegistrationSubscription/041_04.json new file mode 100644 index 0000000000000000000000000000000000000000..656a1916374214cc77f6d36d9529fae1bd5d400e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_04.json @@ -0,0 +1,66 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/041_04", + "test_objective": "Check that you cannot query context source registration subscriptions with invalid page and limit parameters", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.5", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_5", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "041_04_01 Invalid Limit", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_04_01", + "doc": "Check that you cannot query context source registration subscriptions with invalid page and limit parameters", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 400 and\n Query Context Source Registration Subscriptions with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registration Subscriptions with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: limit set to '${-5}' and\n Query Parameter: page set to '${2}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_04_02 Invalid Page", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_04_02", + "doc": "Check that you cannot query context source registration subscriptions with invalid page and limit parameters", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 400 and\n Query Context Source Registration Subscriptions with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registration Subscriptions with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: limit set to '${2}' and\n Query Parameter: page set to '${-3}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "041_04_03 Invalid Limit And Page", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/041_04_03", + "doc": "Check that you cannot query context source registration subscriptions with invalid page and limit parameters", + "tags": [ + "5_11_5", + "csrsub-query" + ], + "setup": null, + "teardown": null, + "template": "Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Context Source Registration Subscriptions with Response Status Code set to 400 and\n Query Context Source Registration Subscriptions with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Query Context Source Registration Subscriptions with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Query Context Source Registration Subscriptions and\n Query Parameter: limit set to '${0}' and\n Query Parameter: page set to '${0}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions", + "robotfile": "041_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/042_01.json b/doc/files/ContextSource/RegistrationSubscription/042_01.json new file mode 100644 index 0000000000000000000000000000000000000000..01ab87dbb9a2a0f2a2a07c0d24b0d765c175473e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_01.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/042_01", + "test_objective": "Check that you can delete a context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "042_01_01 Delete Context Source Registration Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/042_01_01", + "doc": "Check that you can delete a context source registration subscription", + "tags": [ + "5_11_6", + "csrsub-delete" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration Subscription with Response Status Code set to 204 and\n Retrieve Context Source Registration Subscription with Response Status Code set to ${response1.status_code}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Context Source Registration Subscription with id set to '${subscription_id}'\n}", + "http_verb": "DELETE", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription", + "robotfile": "042_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/042_02.json b/doc/files/ContextSource/RegistrationSubscription/042_02.json new file mode 100644 index 0000000000000000000000000000000000000000..ccc39cd639012ec031b3409e208803f22c491091 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/042_02", + "test_objective": "Check that you cannot delete a context source registration subscription with an invalid URI", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "042_02_01 Delete Context Source Registration Subscription With Invalid Uri", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/042_02_01", + "doc": "Check that you cannot delete a context source registration subscription with an invalid URI", + "tags": [ + "5_11_6", + "csrsub-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration Subscription with Response Status Code set to 400 and\n Delete Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Delete Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Context Source Registration Subscription with id set to 'invalidUri'\n}", + "http_verb": "DELETE", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription", + "robotfile": "042_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/042_03.json b/doc/files/ContextSource/RegistrationSubscription/042_03.json new file mode 100644 index 0000000000000000000000000000000000000000..f64ae2c6eb7ceb424d20a4d654e81a42c73be3d4 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/042_03", + "test_objective": "Check that you cannot delete an unknown context source registration subscription", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.6", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_6", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "042_03_01 Delete Unknown Context Source Registration Subscription With Invalid Uri", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/042_03_01", + "doc": "Check that you cannot delete an unknown context source registration subscription", + "tags": [ + "5_11_6", + "csrsub-delete" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration Subscription with Response Status Code set to 404 and\n Delete Context Source Registration Subscription with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Delete Context Source Registration Subscription with Response body containing 'title' element\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'DELETE'\n Delete Context Source Registration Subscription with id set to 'urn:ngsi-ld:Subscription:unknowSubscription'\n}", + "http_verb": "DELETE", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription", + "robotfile": "042_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_01.json b/doc/files/ContextSource/RegistrationSubscription/047_01.json new file mode 100644 index 0000000000000000000000000000000000000000..a1bb739067a600af928721915e1990e8a8c7b1d5 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_01", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [ + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration And Subscription" + ], + "teardown": "Delete Created Context Source Registration And Subscription", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "047_01_01 Receive cSourceNotification Periodically And Initially On Subscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_01_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received After waiting '15' seconds\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_01" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_02.json b/doc/files/ContextSource/RegistrationSubscription/047_02.json new file mode 100644 index 0000000000000000000000000000000000000000..54128041dc7c2cf6594ca713ab0aafe3690f0147 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_02.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_02", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration (CSR1) providing latest information about some entities\n and the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_02_01 Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_02_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Create Initial Context Source Registration and Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Context Source Registration Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'updated' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with CSR Id set to '${context_source_registration_id}' and subscription update fragment set to '${update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_02" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_03.json b/doc/files/ContextSource/RegistrationSubscription/047_03.json new file mode 100644 index 0000000000000000000000000000000000000000..5f9a411e52d65784f7f5b832a50fbc1a880fb257 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_03.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_03", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_03_01 Receive cSourceNotification With Relevant Information", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_03_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to 'expected_notification_data_entities' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_03" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_04.json b/doc/files/ContextSource/RegistrationSubscription/047_04.json new file mode 100644 index 0000000000000000000000000000000000000000..3fe3ea313230e313b151bbbe7ff4a36302d2c0a8 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_04.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_04", + "test_objective": "The structure of the csource notification message shall be as mandated by clause 5.3.2", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_04_01 Receive cSourceNotification With Compliant Structure", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_04_01", + "doc": "The structure of the csource notification message shall be as mandated by clause 5.3.2", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_04" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_05.json b/doc/files/ContextSource/RegistrationSubscription/047_05.json new file mode 100644 index 0000000000000000000000000000000000000000..5dd4140ed1a5ee6a7cbdc82bf44f7069e9b41b5f --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_05.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_05", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_05_01 If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_05_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Context Source Registration Subscription with Response containing:\n * Notification expectation file path set to 'notifications/expectations/1-timesSent-ok.json'\n * Expected Additional Members set to '${expected_notification_additional_members}'\n * Response Body set to '${response.json()}'\n\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to '${subscription_id}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_06.json b/doc/files/ContextSource/RegistrationSubscription/047_06.json new file mode 100644 index 0000000000000000000000000000000000000000..4c5b3cc96d3f74c9e6ca785fab112f3164e67f3a --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_06.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_06", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_06_01 If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_06_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Context Source Registration Subscription with Response containing:\n * Notification expectation file path set to 'notifications/expectations/1-timesSent-failed.json'\n * Expected Additional Members set to '${expected_notification_additional_members}'\n * Response Body set to '${response.json()}'\n\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to '${subscription_id}'\n}", + "http_verb": "GET", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_06" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_07.json b/doc/files/ContextSource/RegistrationSubscription/047_07.json new file mode 100644 index 0000000000000000000000000000000000000000..568159374fc310e7eef0cb451c210bf2c58dab7d --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_07.json @@ -0,0 +1,48 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_07", + "test_objective": "Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_07_01 PausedSubscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_07_01", + "doc": "Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": "Do Not Receive cSourceNotification If Subscription Status Is Not Active", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for no Notification data and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + }, + { + "name": "047_07_02 ExpiredSubscription", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_07_02", + "doc": "Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": "Do Not Receive cSourceNotification If Subscription Status Is Not Active", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for no Notification data and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_07" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_08.json b/doc/files/ContextSource/RegistrationSubscription/047_08.json new file mode 100644 index 0000000000000000000000000000000000000000..ea59296bb9cc1c065931b3ac5f1febaa37469e28 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_08.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_08", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration (CSR1) providing latest information about some entities\n and the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_08_01 Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_08_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Create Initial Context Source Registration and Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Context Source Registration Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'updated' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with CSR Id set to '${context_source_registration_id}' and subscription update fragment set to '${update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_08" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_09.json b/doc/files/ContextSource/RegistrationSubscription/047_09.json new file mode 100644 index 0000000000000000000000000000000000000000..8c00a9e0b5ccf40fe72ea88824d5d95b0158bf09 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_09.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_09", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [ + "Create Initial Context Source Registration And Context Source Registration Subscription", + "Delete Created Context Source Registration And Context Source Registration Subscription" + ], + "teardown": "Delete Created Context Source Registration And Context Source Registration Subscription", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "047_09_01 Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_09_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'noLongerMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{context_source_registration_id}'\n method set to 'PATCH'\n Update Context Source Registration with CSR Id set to '${context_source_registration_id}' and subscription update fragment set to '${update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{context_source_registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_09" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_10.json b/doc/files/ContextSource/RegistrationSubscription/047_10.json new file mode 100644 index 0000000000000000000000000000000000000000..2b444a097d72b49a0d452400107c368a842c5cb0 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_10.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_10", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_10_01 Receive cSourceNotification For Matching Context Source Registrations On Observation Interval", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_10_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_10" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_11.json b/doc/files/ContextSource/RegistrationSubscription/047_11.json new file mode 100644 index 0000000000000000000000000000000000000000..d0c847e62adf0e3dd2dffc605c2b2cc4ec21f4ad --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_11.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_11", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [ + "Start Local Server", + "Stop Local Server" + ], + "teardown": "Stop Local Server", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "047_11_01 CreatedAt", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_11_01", + "doc": "Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": null, + "teardown": "Delete Created Context Source Registrations", + "template": "Receive cSourceNotification For Matching Context Source Registrations On Management Interval", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + }, + { + "name": "047_11_02 ModifiedAt", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_11_02", + "doc": "Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": null, + "teardown": "Delete Created Context Source Registrations", + "template": "Receive cSourceNotification For Matching Context Source Registrations On Management Interval", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "csourceSubscriptions" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_11" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_12.json b/doc/files/ContextSource/RegistrationSubscription/047_12.json new file mode 100644 index 0000000000000000000000000000000000000000..a5f73644a083f5c2a0d2ee4f307245eae07c8f55 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_12.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_12", + "test_objective": "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\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_12_01 Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_12_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_12" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_13.json b/doc/files/ContextSource/RegistrationSubscription/047_13.json new file mode 100644 index 0000000000000000000000000000000000000000..8a3fd2afda233beb39aea1dc776a719abf84c41c --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_13.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_13", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_13_01 Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_13_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_13" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_14.json b/doc/files/ContextSource/RegistrationSubscription/047_14.json new file mode 100644 index 0000000000000000000000000000000000000000..33c7266a6bc6a2f93b38259e2b3e1128aed152bc --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_14.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_14", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_14_01 Receive cSourceNotification For Matching Context Source Registrations On Location", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_14_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_14" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_15.json b/doc/files/ContextSource/RegistrationSubscription/047_15.json new file mode 100644 index 0000000000000000000000000000000000000000..88382cb7f185caf7c7ab32d55184348cac9fb55e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_15.json @@ -0,0 +1,32 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_15", + "test_objective": "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", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_15_01 Receive cSourceNotification For Matching Context Source Registrations On Location As Default", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_15_01", + "doc": "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": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Setup Initial Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registration And Subscription", + "template": null, + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'expected_context_source_registration_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Create Context Source Registration Request with Content-Type set to 'application/ld+json' and payload set to '${context_source_registration_payload}'\n}", + "http_verb": "POST", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_15" +} \ No newline at end of file diff --git a/doc/files/ContextSource/RegistrationSubscription/047_16.json b/doc/files/ContextSource/RegistrationSubscription/047_16.json new file mode 100644 index 0000000000000000000000000000000000000000..a5dc97e0a7ba38ac0fe1a1dd6d97a9a71cf0f68d --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_16.json @@ -0,0 +1,64 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REGSUB/047_16", + "test_objective": "Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.11.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_11_7", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a list of Context Source Registrations (CSRs) providing latest information about some entities\n and the SUT containing a Context Source Registration Subscription (CSRS1)\n}", + "test_cases": [ + { + "name": "047_16_01 MatchFirstContextSourceRegistration", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_16_01", + "doc": "Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", + "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + }, + { + "name": "047_16_02 MatchSecondContextSourceRegistration", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_16_02", + "doc": "Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", + "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + }, + { + "name": "047_16_03 MatchBothContextSourceRegistrations", + "permutation_tp_id": "TP/NGSI-LD/CS/REGSUB/047_16_03", + "doc": "Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations", + "tags": [ + "5_11_7", + "csrsub-notification" + ], + "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", + "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", + "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", + "http_verb": "PATCH", + "endpoint": "csourceSubscriptions/{subscription_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", + "robotfile": "047_16" +} \ No newline at end of file diff --git a/doc/generateDocumentationData.py b/doc/generateDocumentationData.py new file mode 100644 index 0000000000000000000000000000000000000000..a79afb12dd6c559bf173a960dc1b08e4aac248d1 --- /dev/null +++ b/doc/generateDocumentationData.py @@ -0,0 +1,59 @@ +from analysis.generaterobotdata import GenerateRobotData +from json import dump +from sys import argv +from os.path import dirname, exists +from os import makedirs, walk + + +def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics: bool=False): + # TODO: ApiUtils.resource -> 'Delete Context Source Registration Subscription' added 'url=' as parameter + folder_test_suites = dirname(dirname(__file__)) + + folder_result_path = f'{folder_test_suites}/doc/results' + result_file = f'{folder_result_path}/{robot_file_to_be_processed}.json' + robot_path_to_be_processed, robot_file = find_robot_file(basedir=folder_test_suites, + filename=robot_file_to_be_processed) + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_result_path): + makedirs(folder_result_path) + + if computestatistics: + try: + data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) + data.parse_robot() + info = data.get_info() + except Exception as e: + print("WHILE GENERATING ROBOT DATA:", e) + info = dict() + info["error_while_parsing"] = True + info["robotfile"] = robot_file_to_be_processed + if(robot_path_to_be_processed.startswith("/")): + robot_path_to_be_processed = robot_path_to_be_processed[1:] + info["robotpath"] = robot_path_to_be_processed + else: + data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) + data.parse_robot() + info = data.get_info() + + with open(result_file, 'w') as fp: + dump(obj=info, indent=2, fp=fp) + + return info + + +def find_robot_file(basedir: str, filename: str): + filename = f'{filename}.robot' + for root, dirs, files in walk(basedir): + if filename in files: + return root.replace(f'{basedir}/TP/NGSI-LD', ''), f'{root}/{filename}' + + return None, None + + +if __name__ == "__main__": + # Call with the folder below /TP/NGSI-LD which contains the robot file with name args[0] + args = argv[1:] + robot_file_tbp = args[0] + resulting_json = create_json_of_robotfile(robot_file_tbp) + print("Correctly exiting") diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py new file mode 100644 index 0000000000000000000000000000000000000000..d9902b84fb06c8780b073daee84d3d703fff5796 --- /dev/null +++ b/doc/statisticsDocumentationData.py @@ -0,0 +1,44 @@ +from generateDocumentationData import create_json_of_robotfile +from os.path import dirname +from os import walk +from json import dump + +if __name__ == "__main__": + basedir = dirname(dirname(__file__)) + statistics = dict() + testcases = [] + number_of_failures = 0 + number_of_all_testcases = 0 + number_of_successes = 0 + ROBOT_FILE_EXTENSION = ".robot" + + fullpath = basedir+"/TP/NGSI-LD" + for root, dirs, files in walk(fullpath): + for filename in files: + if filename.endswith(ROBOT_FILE_EXTENSION): + number_of_all_testcases += 1 + name_of_test_case = filename[:-len(ROBOT_FILE_EXTENSION)] + json_of_test_case = create_json_of_robotfile(name_of_test_case, True) + statistics[name_of_test_case] = dict() + strippedpath = root[len(fullpath)+1:] + statistics[name_of_test_case]["path"] = strippedpath + if "error_while_parsing" in json_of_test_case and json_of_test_case["error_while_parsing"]: + statistics[name_of_test_case]["failed"] = True + number_of_failures += 1 + else: + statistics[name_of_test_case]["failed"] = False + number_of_successes += 1 + testcases.append(json_of_test_case) + + print() + print() + print() + print("THE FOLLOWING TESTCASES FAILED PARSING:") + for testcasename, testcaseresult in statistics.items(): + if testcaseresult["failed"]: + print(testcasename+" "+testcaseresult["path"]) + + print(f"Out of {number_of_all_testcases} testcases, {number_of_failures} of them failed to be correctly parsed.") + + with open("./results/testcases.json", 'w') as fp: + dump(obj=testcases, indent=2, fp=fp) diff --git a/doc/tests/__init__.py b/doc/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/tests/test_CheckTests.py b/doc/tests/test_CheckTests.py new file mode 100644 index 0000000000000000000000000000000000000000..d807a34bf6b4c84cef0f9ac69a6f018be27f611c --- /dev/null +++ b/doc/tests/test_CheckTests.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +import re +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists, join, basename, splitext +from os import walk, listdir, remove, makedirs + + +class TestCheckTests(TestCase): + # 6 passed + def setUp(self) -> None: + folder_test_suites = dirname(dirname(dirname(__file__))) + self.robot_files = list() + self.test_lines = list() + + self.search_files_by_extension(directory='/home/fla/Documents/workspace/bdd/ngsi-ld-test-suite/TP/NGSI-LD', + extension='robot') + + self.search_lines_by_string_and_extension(directory='/home/fla/Documents/workspace/bdd/ngsi-ld-test-suite/doc/tests', + extension='py', + string='def test') + + self.robots = [splitext(basename(x))[0] for x in self.robot_files] + tests = [TestCheckTests.extract_number_test(string=x[1]) for x in self.test_lines] + self.tests = [x for x in tests if x != ''] + + + def search_files_by_extension(self, directory, extension): + for root, dirnames, filenames in walk(directory): + for filename in filenames: + if filename.endswith(extension): + self.robot_files.append(join(root, filename)) + + def search_lines_by_string_and_extension(self, directory, extension, string): + for root, dirnames, filenames in walk(directory): + for filename in filenames: + if filename.endswith(extension): + file_path = join(root, filename) + with open(file_path, 'r') as file: + for line in file: + if string in line: + self.test_lines.append((file_path,line.strip())) + + @staticmethod + def extract_number_test(string: str) -> str: + match = re.findall(pattern=r"[a-zA-Z ]+_([0-9_]+)", string=string) + if len(match) == 1: + return match[0] + else: + return '' + + def test_number_files_equal_number_tests(self): + print("checking") + number_robot_files = len(self.robot_files) + number_test_lines = len(self.test_lines) - 4 + assert number_robot_files == number_test_lines, f"The number of robot files '{number_robot_files}' is not the same as number of test cases '{number_test_lines}'" + + def test_specific_robot_file_has_a_test(self): + check = [item for item in self.robots if item not in self.tests] + check = [item for item in self.robot_files if any(string in item for string in check)] + + assert len(check) == 0, f"The following robot files are missing from unittest:\n '{check}'" + + def test_that_all_tests_have_the_corresponding_robot_files(self): + check = [item for item in self.tests if item not in self.robots] + check = [item for item in self.test_lines if any(string in item[1] for string in check)] + + assert len(check) == 0, f"The following unit tests are missing their robot files:\n '{check}'" diff --git a/doc/tests/test_CommonBehaviours.py b/doc/tests/test_CommonBehaviours.py new file mode 100644 index 0000000000000000000000000000000000000000..80ffd362a0c33e701b4a2305716a09e1ec6ea61e --- /dev/null +++ b/doc/tests/test_CommonBehaviours.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestCommonBehaviours(TestCase): + # 6 passed + @classmethod + def setUpClass(cls): + TestCommonBehaviours.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCommonBehaviours.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_043_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/043_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_043_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_044_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_044_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_045_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/045_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_045_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_048_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/048_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_048_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_049_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/049_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_049_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_049_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/049_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_049_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py new file mode 100644 index 0000000000000000000000000000000000000000..8f059be8ed6757c0cbca3deec20ff8bb64e12867 --- /dev/null +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -0,0 +1,449 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestCIConsumptions(TestCase): + # 58 passed + @classmethod + def setUpClass(cls): + TestCIConsumptions.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCIConsumptions.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_027_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/027_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_027_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_027_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/027_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_027_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_025_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/025_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_025_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_022_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/022_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_022_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_026_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/026_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_026_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_023_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/023_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_023_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_024_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/024_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_024_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_024_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/024_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_024_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_01_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_01_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_01_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_01_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_01_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_01_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_01_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_01_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_01_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_01_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_01_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_01_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_01_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_01_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_03_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_03_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_03_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_03_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_03_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_03_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_12(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_12.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_12.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_13(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_13.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_13.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextInformation_Provision.py b/doc/tests/test_ContextInformation_Provision.py new file mode 100644 index 0000000000000000000000000000000000000000..9159720b86a16e2c908be428fd186ebb319482a1 --- /dev/null +++ b/doc/tests/test_ContextInformation_Provision.py @@ -0,0 +1,526 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestCIProvision(TestCase): + # 16 failed, 53 passed + @classmethod + def setUpClass(cls): + TestCIProvision.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCIProvision.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_003_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_003_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/003_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_003_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_006_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/006_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_006_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_006_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/006_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_006_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_006_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/006_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_006_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_005_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/005_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_005_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_005_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/005_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_005_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_005_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/005_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_005_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_005_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/005_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_005_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_004_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/004_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_004_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_002_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/002_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_002_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_002_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/002_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_002_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_002_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/002_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_002_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_013_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_013_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_013_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_012_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_012_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_012_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_012_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_012_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_012_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_011_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/011_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_011_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_011_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/011_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_011_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_011_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/011_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_011_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_011_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/011_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_011_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_007_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/007_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_007_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_007_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/007_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_007_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_007_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/007_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_007_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_009_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/009_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_009_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_009_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/009_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_009_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_009_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/009_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_009_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_008_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/008_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_008_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_014_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/014_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_014_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_014_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/014_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_014_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_014_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/014_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_014_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_014_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/014_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_014_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_015_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/015_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_015_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_015_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/015_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_015_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_015_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/015_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_015_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_017_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/017_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_017_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_017_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/017_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_017_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_017_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/017_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_017_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_016_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/016_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_016_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_016_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/016_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_016_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_016_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/016_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_016_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextInformation_Subscription.py b/doc/tests/test_ContextInformation_Subscription.py new file mode 100644 index 0000000000000000000000000000000000000000..215414cad4237214446a3b1b3bc8491f664eac3f --- /dev/null +++ b/doc/tests/test_ContextInformation_Subscription.py @@ -0,0 +1,308 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestCISubscription(TestCase): + # 8 failed, 28 passed + @classmethod + def setUpClass(cls): + TestCISubscription.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCISubscription.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_028_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/028_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_028_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_028_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/028_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_028_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_028_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/028_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_028_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_028_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/028_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_028_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_032_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/032_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_032_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_032_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/032_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_032_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_032_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/032_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_032_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_12(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_12.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_12.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_13(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_13.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_13.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_046_14(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_14.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_14.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_031_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/031_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_031_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_031_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/031_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_031_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_030_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/030_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_030_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_030_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/030_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_030_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_030_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/030_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_030_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + print("WARNING, (029_06) there is a important miss alignment with the documentation") + + def test_029_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_029_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + print("WARNING, (029_09) there is a important miss alignment with the documentation") + + def test_029_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + print("WARNING, (029_10) there is a important miss alignment with the documentation") + + def test_029_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_029_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextSource_Discovery.py b/doc/tests/test_ContextSource_Discovery.py new file mode 100644 index 0000000000000000000000000000000000000000..933da9281764603d5f8478c19e65441ba30ddf64 --- /dev/null +++ b/doc/tests/test_ContextSource_Discovery.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs +import warnings + + +class TestCSRegistration(TestCase): + # 2 failed, 33 passed + @classmethod + def setUpClass(cls): + TestCSRegistration.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCSRegistration.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_037_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_037_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/037_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_037_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_036_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/036_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_036_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_036_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/036_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_036_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_036_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/036_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_036_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_036_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/036_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_036_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_036_05(self): + # self.fail("(036_05) Test Suite with Test Template, not yet implemented") + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Discovery/036_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_036_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextSource_Registration.py b/doc/tests/test_ContextSource_Registration.py new file mode 100644 index 0000000000000000000000000000000000000000..56d8c6877a13ed6b8e5de1e583d84322611aa85a --- /dev/null +++ b/doc/tests/test_ContextSource_Registration.py @@ -0,0 +1,175 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs +import warnings + + +class TestCSRegistration(TestCase): + # 2 failed, 33 passed + @classmethod + def setUpClass(cls): + TestCSRegistration.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCSRegistration.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_033_01_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_01_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_01_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_02.json' + + def test_033_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_033_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_033_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_035_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/035_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_035_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_035_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/035_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_035_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_035_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/035_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_035_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_034_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_034_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_034_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_034_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextSource_RegistrationSubscription.py b/doc/tests/test_ContextSource_RegistrationSubscription.py new file mode 100644 index 0000000000000000000000000000000000000000..3f73c18946bdcbf58384e4f614ab4c1f985fb48d --- /dev/null +++ b/doc/tests/test_ContextSource_RegistrationSubscription.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs +import warnings + + +class TestCSRegistrationSubscription(TestCase): + # 14 failed, 26 passed + @classmethod + def setUpClass(cls): + TestCSRegistrationSubscription.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCSRegistrationSubscription.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_038_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_038_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/038_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_038_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_042_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/042_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_042_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_042_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/042_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_042_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_042_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/042_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_042_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_12(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_12.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_12.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_13(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_13.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_13.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_14(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_14.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_14.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_15(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_15.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_15.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_047_16(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/047_16.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_047_16.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_041_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/041_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_041_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_041_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/041_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_041_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_041_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/041_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_041_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_041_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/041_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_041_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_040_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/040_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_040_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_040_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/040_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_040_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_040_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/040_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_040_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_039_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/039_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_039_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_039_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/039_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_039_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_039_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/039_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_039_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_039_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/039_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_039_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_039_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/RegistrationSubscription/039_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_039_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/libraries/ErrorListener.py b/libraries/ErrorListener.py index 6cd09f11dfcdfc6383e9f4f138c0242235c59fea..2e6ae719fe798ec1d33cb4542c5315edaebf266d 100644 --- a/libraries/ErrorListener.py +++ b/libraries/ErrorListener.py @@ -1,17 +1,78 @@ -from os.path import join -from os import getcwd +from os.path import join, splitext, exists +from os import getcwd, remove from re import compile, match, MULTILINE +from json import loads, dumps +from http import HTTPStatus +from convertMD import Markdown +from githubIssue import GitHubIssue +from robot.running.context import EXECUTION_CONTEXTS + + +def __get_header__(dictionary: dict, key: str) -> str: + result = str() + try: + result = f' {key}: {dictionary["headers"][key]}\n' + return result + except KeyError: + pass + + +def __get_status_meaning__(status_code): + try: + status = HTTPStatus(status_code) + return status.phrase + except ValueError: + return "Unknown status code" + + +def __is_string_dict__(string: str) -> bool: + try: + json_object = loads(string) + if isinstance(json_object, dict): + return True + except ValueError: + pass + return False + + +def __flatten_concatenation__(matrix): + flat_list = [] + for row in matrix: + if isinstance(row, str): + flat_list.append(row) + else: + flat_list += row + + return flat_list + + +def __get_body__(dictionary: dict): + result = str() + if dictionary is None: + result = ' No body\n' + else: + result = dumps(dictionary, indent=2) + result = (result.replace('\n', '\n ') + .replace("{", " {") + .replace("[", " [") + '\n') + + return result class ErrorListener: ROBOT_LISTENER_API_VERSION = 2 def __init__(self, filename='errors.log'): - self.cwd = getcwd() - out_path = join('results', filename) - self.max_length = 150 - self.outfile = open(out_path, 'w') - self.tests = str() + self.filename_md = None + self.filename_log = None + self.cwd = None + self.outfile = None + self.previous_content = str() + self.filename = filename + + self.max_length_suite = 150 + self.max_length_case = 80 + self.tests = list() self.suite_name = str() self.rx_dict = { 'variables': compile('^\${.*$|^\&{.*$|^\@{.*'), @@ -23,31 +84,128 @@ class ErrorListener: '^CONNECT.*(Request|Response).*$|' '^OPTIONS.*(Request|Response).*$|' '^TRACE.*(Request|Response).*$|' - '^PATCH.*(Request|Response).*$', MULTILINE) + '^PATCH.*(Request|Response).*$', MULTILINE), + 'length_log': compile('^Length is \d+$') } + def generate_file_path(self): + if self.outfile is None: + # This is the first time that we execute the test therefore we configure the filenames + ns = EXECUTION_CONTEXTS.current + output_dir = ns.variables.current.store.data['OUTPUT_DIR'] + + basename = splitext(self.filename)[0] + self.filename_log = join(output_dir, self.filename) + self.filename_md = join(output_dir, f'{basename}.md') + + self.cwd = getcwd() + self.outfile = open(self.filename_log, 'w') + + # Check if a previous version of the markdown file exists in the folder, then we delete it in order + # not to append to this file + if exists(self.filename_md): + remove(self.filename_md) + def start_suite(self, name, attrs): + self.generate_file_path() + self.suite_name = attrs['source'].replace(self.cwd, '')[1:].replace('.robot', '').replace('/', ".") - self.outfile.write(f'{"=" * self.max_length}\n') - self.outfile.write(f'{self.suite_name} :: {attrs["doc"]}\n') - self.outfile.write(f'{"=" * self.max_length}\n') + + if attrs['doc'] != '': + self.outfile.write(f'{"=" * self.max_length_suite}\n') + self.outfile.write(f'{self.suite_name} :: {attrs["doc"]}\n') + self.outfile.write(f'{"=" * self.max_length_suite}\n') def start_test(self, name, attrs): - self.tests = f"{name} :: {attrs['doc']}\n" + self.tests.append(f"\n\n{name}\n") + self.tests.append(f'{"=" * self.max_length_case}\n') def end_test(self, name, attrs): if attrs['status'] != 'PASS': - self.outfile.write(self.tests) - self.outfile.write(f'| FAIL |\n{attrs["message"]}\n') - self.outfile.write(f'{"-" * self.max_length}\n') + flat_list = __flatten_concatenation__(matrix=self.tests) + [self.outfile.write(x) for x in flat_list if x is not None] + self.tests.clear() def end_suite(self, name, attrs): - self.outfile.write(f'{self.suite_name} :: {attrs["doc"]}... | {attrs["status"]} |\n{attrs["statistics"]}\n') + self.outfile.write('\n\n\n') + self.outfile.close() + + try: + # If there was an error, generate the markdown content and upload an issue in the corresponding + # GitHub Repository + md = Markdown(filename=self.filename_log, previous_content=self.previous_content) + md.get_names() + # md.generate_md() + self.previous_content = md.save_file(filename=self.filename_md) + + # Check if we have defined the GitHub parameters in the variables.py file, if this is the case upload + # gh = GitHubIssue(issue_title=f'{attrs["longname"]} - {attrs["doc"]}', issue_content=md.get_markdown()) + + # gh.create_issues() + except KeyError as err: + print(f'\n[ERROR] Unexpected {err=}, {type(err)=} in TC {self.suite_name}\n\n') + except IndexError as err: + print(f'\n[ERROR] Unexpected {err=}, {type(err)=} in TC {self.suite_name}\n\n') + except Exception as err: + print(f'\n[ERROR] Unexpected {err=}, {type(err)=} in TC {self.suite_name}\n\n') + + # We need to reopen the file in case that we are executing several TCs + self.outfile = open(self.filename_log, 'a') def log_message(self, msg): if (not match(pattern=self.rx_dict['variables'], string=msg['message']) and not match(pattern=self.rx_dict['http_verbs'], string=msg['message'])): - self.outfile.write(f'{msg["message"]}\n') + self.tests.append(self.__get_message__(msg["message"])) def close(self): + self.outfile.write('\n\n\n') self.outfile.close() + + def __get_message__(self, message: str) -> str: + result = str() + if message == 'Request ->': + result = f'\n\nRequest:\n{"-" * self.max_length_case}\n' + elif message == 'Response ->': + result = f'\n\nResponse:\n{"-" * self.max_length_case}\n' + elif __is_string_dict__(string=message): + result = self.__generate_pretty_output__(data=message) + elif message[0] == '\n': + # This is the title of a test case operation + result = message + elif message == 'Dictionary comparison failed with -> ': + result == None + elif match(pattern=self.rx_dict['length_log'], string=message) is None: + result = f'\nMismatch:\n{"-" * self.max_length_case}\n{message}\n' + + return result + + def __generate_pretty_output__(self, data: str) -> list: + data = loads(data) + + output = list() + + received_header_keys = data['headers'].keys() + + if 'User-Agent' in received_header_keys: + # User-Agent is a Request Header, therefore we generate the request header + output.append(f' {data["method"]} {data["url"]}\n') + + [output.append(__get_header__(dictionary=data, key=x)) for x in list(received_header_keys)] + + output.append('\n') + + output.append(__get_body__(dictionary=data['body'])) + else: + # This is a Response header + # robotframework-requests is based on python request, so it is using HTTP/1.1 + output.append(f' HTTP/1.1 {data["status_code"]} {__get_status_meaning__(data["status_code"])}\n') + + [output.append(__get_header__(dictionary=data, key=x)) for x in list(received_header_keys)] + + output.append(f' Date: REGEX(. *)\n') + + output.append('\n') + + output.append(__get_body__(dictionary=data['body'])) + + return output diff --git a/libraries/convertMD.py b/libraries/convertMD.py new file mode 100644 index 0000000000000000000000000000000000000000..5fb39483f5452093e1fb2afb101981823952ee66 --- /dev/null +++ b/libraries/convertMD.py @@ -0,0 +1,114 @@ +from re import compile, match, findall, MULTILINE +from difflib import SequenceMatcher + + +def get_string_difference(string1: str, string2: str) -> str: + differ = SequenceMatcher(None, string1, string2) + differences = differ.get_opcodes() + diff_string = "" + + for tag, i1, i2, j1, j2 in differences: + if tag == 'delete' or tag == 'replace': + diff_string += string1[i1:i2] + elif tag == 'insert' or tag == 'replace': + diff_string += string2[j1:j2] + + return diff_string + + +class Markdown: + def __init__(self, filename: str, previous_content: str): + # Read the content of the input file + with open(filename, 'r') as file: + self.content = file.read() + file.close() + + # Initial previous content + if previous_content != '': + # If there was a previous content in the file, take the difference to do the process + self.content = get_string_difference(string1=previous_content, string2=self.content) + + self.data = { + "suite": str(), + "cases": list(), + "steps": list() + } + + self.markdown_content = str() + + def get_names(self): + pattern1 = compile('^(\S+.*)$', MULTILINE) + + aux = findall(pattern=pattern1, string=self.content) + + special_lines = ['Response:', 'Request:', 'Mismatch:', f'{"=" * 150}', f'{"=" * 80}', f'{"-" * 80}'] + xs = [x for x in aux if x not in special_lines] + + prefixes_to_remove = ["Item ", "+ ", "- ", "Value of ", "HTTP status code", "HTTPError:", "AttributeError:"] + xs = [item for item in xs if not any(item.startswith(prefix) for prefix in prefixes_to_remove)] + + # Get the name of the Test Suite + self.data["suite"] = xs[0] + + # Get the names of the Test Cases + try: + pattern = r"\d{3}\w+" + self.data["cases"] = [item for item in xs if match(pattern, item)] + except IndexError as err: + print(f'\n[ERROR] Unexpected {err=}, {type(err)=} in TC {self.suite_name}\n\n') + + # Get the rest of values -> Steps + # Get items from listA not present in listB and not equal to exclude_string + self.data['steps'] = [item for item in xs if item not in self.data['cases'] and item != self.data['suite']] + self.data['steps'] = list(set(self.data['steps'])) + + def generate_md(self): + # Replace the title of the Test Suite + self.markdown_content = self.content + self.markdown_content = ( + self.markdown_content.replace(f'{"=" * 150}\n{self.data["suite"]}\n{"=" * 150}', f'# {self.data["suite"]}')) + + # Replace the name of the Test Cases + for x in self.data['cases']: + self.markdown_content = ( + self.markdown_content.replace(f'{x}\n{"=" * 80}\n', f'```\n## {x}\n')) + + # Replace Request, Response, and Mismatch + self.markdown_content = (self.markdown_content.replace(f'Request:\n{"-" * 80}', '#### Request:\n```') + .replace(f'Response:\n{"-" * 80}', '```\n\n#### Response:\n```') + .replace(f'Mismatch:\n{"-" * 80}', '```\n\n#### Mismatch:\n```')) + + # Replace the name of the steps + for x in self.data['steps']: + self.markdown_content = ( + self.markdown_content.replace(f'{x}\n', f'```\n### {x}\n')) + + # Final steps, correct the code style for the title of the Test Cases + # Define patterns and replacement strings + index = True + for x in self.data['cases']: + if index: + self.markdown_content = ( + self.markdown_content.replace(f'```\n## {x}\n\n```\n', f'## {x}\n\n')) + index = False + else: + self.markdown_content = ( + self.markdown_content.replace(f'```\n## {x}\n\n```\n', f'```\n## {x}\n\n')) + + # If the final number of "```" is odd, means that we need to close the last code section + # this is a workaround to close the last section of code if this is keep open + count = self.markdown_content.count("```") + if count % 2 == 1: + print(True) + self.markdown_content = f"{self.markdown_content}\n```" + + def save_file(self, filename: str): + # Write the Markdown content to the output file + with open(filename, 'a') as file: + file.write(self.markdown_content) + file.close() + + return self.content + + def get_markdown(self) -> str: + return self.markdown_content diff --git a/libraries/githubIssue.py b/libraries/githubIssue.py new file mode 100644 index 0000000000000000000000000000000000000000..8163a660d060861cf546d32218013de6983fb927 --- /dev/null +++ b/libraries/githubIssue.py @@ -0,0 +1,148 @@ +from requests import post, get +from re import finditer +from json import loads + +try: + from resources.variables import github_owner, github_broker_repo, github_token +except ImportError: + # Some of the variables were not defiled, therefore we cannot execute the operation + classError = True +else: + classError = False + + +class GitHubIssue: + def __init__(self, issue_title: str, issue_content: str): + if classError: + # There is some GitHub parameters not defined, therefore this function does not effect + print("\nSome GitHub parameters were not defined in variables.py") + print("Expected parameters: github_owner, github_broker_repo, github_token") + return + else: + # Get the values of the parameter from the variables.py file + # GitHub repository details + self.url_create = f'https://api.github.com/repos/{github_owner}/{github_broker_repo}/issues' + + self.issue_title = issue_title + self.issue_content = issue_content + + self.test_cases = list() + self.test_cases_title = list() + + def create_issues(self): + if classError: + # There is some GitHub parameters not defined, therefore this function does not effect + print("\nSome GitHub parameters were not defined in variables.py") + print("Expected parameters: github_owner, github_broker_repo, github_token") + return + else: + # Request body, the issue content need to be split into the different Test Cases in order to prevent + # body maximum of 65536 characters + self.generate_test_cases_info() + + for i in range(0, len(self.test_cases_title)): + # We need to check that the issue was not already created previously + # if the issue is created previously and still open we do not create again, + # other case, we create the issue + + # Obtain the extended title of the issue + issue_title = f'{self.issue_title} {self.test_cases_title[i]}' + + # Check the issue + if self.check_duplicate_issue(issue_title=issue_title): + print('\nDuplicate issue found!') + else: + self.create_issue(body=self.test_cases[i]) + + def create_issue(self, body: str): + if classError: + # There is some GitHub parameters not defined, therefore this function does not effect + print("\nSome GitHub parameters were not defined in variables.py") + print("Expected parameters: github_owner, github_broker_repo, github_token") + return + else: + # Issue details + # Data of the issue + data = { + 'title': self.issue_title, + 'body': body + } + + # Request headers + headers = { + 'Accept': 'application/vnd.github.v3+json', + 'Authorization': f'Token {github_token}' + } + + # Send POST request to create the issue + response = post(url=self.url_create, headers=headers, json=data) + + # Check the response status code + if response.status_code == 201: + print('\nIssue created successfully.') + else: + print('\nFailed to create the issue.') + print(f'Response: {response.status_code} - {response.text}') + + def generate_test_cases_info(self): + if classError: + # There is some GitHub parameters not defined, therefore this function does not effect + print("\nSome GitHub parameters were not defined in variables.py") + print("Expected parameters: github_owner, github_broker_repo, github_token") + return + else: + pattern = r'##\s*[0-9]{3}_[0-9]{2}_[0-9]{2}.*\n' # Split on one or more non-word characters + + count = int() + indexes = list() + + match = None + for match in finditer(pattern, self.issue_content): + count += 1 + indexes.append(match.start()) + + if match: + title = self.issue_content[0:indexes[0]] + else: + raise KeyError("Search unsuccessful. It was expected the the name of the Test Cases start with " + "_
_
, where d is a digit, e.g., 027_01_01") + + # Get the list of Test Cases + for i in range(1, len(indexes) + 1): + self.test_cases_title.append(f'({self.issue_content[indexes[i-1]+3:indexes[i-1]+12]})') + + if i < len(indexes): + self.test_cases.append(self.issue_content[indexes[i-1]:indexes[i]]) + else: + self.test_cases.append(self.issue_content[indexes[i-1]:]) + + self.test_cases = [f'{title}\n\n{x}' for x in self.test_cases] + + def check_duplicate_issue(self, issue_title): + if classError: + # There is some GitHub parameters not defined, therefore this function does not effect + print("\nSome GitHub parameters were not defined in variables.py") + print("Expected parameters: github_owner, github_broker_repo, github_token") + return + else: + # Generate the URL of the query + url = f'repo:{github_owner}/{github_broker_repo} is:issue is:open in:title "{issue_title}"' + + # Make the API request + response = get( + 'https://api.github.com/search/issues', + params={'q': url} + ) + + # Check the response status code + if response.status_code == 200: + # Parse the JSON response + data = response.json() + + # Check if any issues were found + if data['total_count'] > 0: + return True # Duplicate issue found + else: + raise Exception(loads(response.text)['errors'][0]['message']) + + return False # No duplicate issue found diff --git a/requirements.txt b/requirements.txt index 094d2d731bd202ba4a5a5a7cf95b04d8d6e6b8c4..b98ebc40f04c841310e84baad2b1755e896736fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ # python3.11 project robotframework==6.1.1 robotframework-jsonlibrary==0.5 -robotframework-requests==0.9.5 -deepdiff==6.5.0 +robotframework-requests==0.9.6 +deepdiff==6.7.1 prettydiff==0.1.0 robotframework-httpctrl==0.3.1 -robotframework-tidy==4.5.0 +robotframework-tidy==4.6.0 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource deleted file mode 100644 index 957e95998cf4fd6820e32fa51e23f1220e2a1b94..0000000000000000000000000000000000000000 --- a/resources/ApiUtils.resource +++ /dev/null @@ -1,1312 +0,0 @@ -*** Settings *** -Variables ./variables.py -Library ${EXECDIR}/libraries/logUtils.py -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/ -${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 - -${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} - - -*** Keywords *** -Delete Entity by Id Returning Response - [Arguments] ${id} - ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any - Output ${response} Delete Entity by Id Returning Response - RETURN ${response} - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any - Output ${response} Delete Entity by Id - RETURN ${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 - 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}= GET - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Entity - RETURN ${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 - 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}= GET - ... url=${url}/${ENTITIES_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Entities - 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} - 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}= POST - ... url=${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} - ... json=${params} - ... headers=${headers} - ... expected_status=any - Output ${response} Query Entities Via POST - RETURN ${response} - -Retrieve Entity by Id - [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}= GET url=${url}/${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Output ${response} Retrieve Entity by Id - RETURN ${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} - 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}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} - ... json=${entity} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Entity Selecting Content Type - RETURN ${response} - -Append Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Append Entity Attributes - 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}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} - ... json=${fragment_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Append Entity Attributes With Parameters - RETURN ${response} - -Update Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= PATCH - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Update Entity Attributes - RETURN ${response} - -Delete Entity Attributes - [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}= DELETE - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} - ... headers=${headers} - ... expected_status=any - Output ${response} Delete Entity Attributes - RETURN ${response} - -Partial Update Entity Attributes - [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}= PATCH - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} - ... json=${fragment_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Partial Update Entity Attributes - RETURN ${response} - -Retrieve Entity Types - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - - &{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}= GET - ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/ - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Retrieve Entity Types - RETURN ${response} - -Retrieve Entity Type - [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} - - &{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}= GET - ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} - ... headers=${headers} - ... expected_status=any - Output ${response} Retrieve Entity Type - RETURN ${response} - -Retrieve Attributes - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - - &{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}= GET - ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Retrieve Attributes - RETURN ${response} - -Retrieve Attribute - [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} - - &{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}= GET - ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} - ... headers=${headers} - ... expected_status=any - Output ${response} Retrieve Attribute - RETURN ${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} - 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}= POST - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... json=${payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Context Source Registration - RETURN ${response} - -Update Context Source Registration With Return - [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... json=${fragment} - ... headers=${headers} - ... expected_status=any - Output ${response} Update Context Source Registration - RETURN ${response} - -Delete Context Source Registration With Return - [Arguments] ${registration_id} - ${response}= DELETE - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... expected_status=any - Output ${response} Delete Context Source Registration - 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}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} - ... json=${entity} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Entity - RETURN ${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} - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ - ... json=${temporal_entity_representation} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Or Update Temporal Representation Of Entity Selecting Content Type - RETURN ${response} - -Create Temporal Representation Of Entity Selecting Content Type - [Arguments] ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Temporal Representation Of Entity Selecting Content Type - RETURN ${response} - -Append Attribute To Temporal Entity - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Append Attribute To Temporal Entity - 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} - 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}= PATCH - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} - ... json=${fragment_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Modify Attribute Instance From Temporal Entity - RETURN ${response} - -Delete Attribute From Temporal Entity - [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}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} - ... headers=${headers} - ... expected_status=any - Output ${response} Delete Attribute From Temporal Entity - RETURN ${response} - -Delete Temporal Representation Of Entity With Returning Response - [Arguments] ${temporal_entity_representation_id} - ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - ... expected_status=any - Output ${response} Delete Temporal Representation Of Entity - RETURN ${response} - -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} - 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}= GET - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Get Temporal Representation Of Entity - RETURN ${response} - -Delete Attribute Instance From Temporal Entity - [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}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} - ... headers=${headers} - ... expected_status=any - Output ${response} Delete Attribute Instance From Temporal Entity - RETURN ${response} - -Update Temporal Representation Of Entity Selecting Content Type - [Arguments] - ... ${temporal_entity_representation_id} - ... ${attrId} - ... ${instanceId} - ... ${fragment_filename} - ... ${content_type} - ${temporal_entity_fragment}= Load JSON From File - ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} - ... json=${temporal_entity_fragment} - ... headers=${headers} - ... expected_status=any - Output ${response} Update Temporal Representation Of Entity Selecting Content Type - RETURN ${response} - -Batch Create Entities - [Arguments] - ... @{entities_to_be_created} - ... ${content_type}=${CONTENT_TYPE_LD_JSON} - ... ${context}=${EMPTY} - ... ${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}= POST - ... url=${url}/${BATCH_CREATE_ENDPOINT_PATH} - ... json=@{entities_to_be_created} - ... headers=${headers} - ... expected_status=any - Output ${response} Batch Create Entities - RETURN ${response} - -Batch Upsert Entities - [Arguments] @{entities_to_be_upserted} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} - ... json=@{entities_to_be_upserted} - ... headers=${headers} - ... expected_status=any - Output ${response} Batch Upsert Entities - RETURN ${response} - -Batch Update Entities - [Arguments] @{entities_to_be_updated} ${overwrite_option}=${EMPTY} - @{params}= Create List - IF '${overwrite_option}'!='' - Append To List ${params} options=${overwrite_option} - END - ${params_as_string}= Catenate SEPARATOR=& @{params} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${BATCH_UPDATE_ENDPOINT_PATH}?${params_as_string} - ... json=@{entities_to_be_updated} - ... headers=${headers} - ... expected_status=any - Output ${response} Batch Update Entities - RETURN ${response} - -Batch Delete Entities - [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${BATCH_DELETE_ENDPOINT_PATH} - ... json=@{entities_ids_to_be_deleted} - ... headers=${headers} - ... expected_status=any - Output ${response} Batch Delete Entities - RETURN ${response} - -Request Entity From File - [Arguments] ${filename} - ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Request Entity From File - RETURN ${response} - -Batch Request Entities From File - [Arguments] ${batchOperation} ${filename} - ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${endpoint_url} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Batch Request Entities From File - RETURN ${response} - -Create Temporal Representation Of Entity - [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To JSON - ... ${temporal_entity_representation_payload} - ... $..id - ... ${temporal_entity_representation_id} - - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... json=${temporal_entity_representation} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Temporal Representation Of Entity - RETURN ${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 - - 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}= GET - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Retrieve Temporal Representation Of Entity - RETURN ${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 - 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}= GET - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Temporal Representation Of Entities - RETURN ${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}= POST - ... url=${url}/${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query - ... json=${query_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Query Temporal Representation Of Entities Via Post - RETURN ${response} - -Delete Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} - - ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - ... expected_status=any - Output ${response} Delete Temporal Representation Of Entity - RETURN ${response} - -Create Context Source Registration - [Arguments] ${context_source_registration_payload} - - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... json=${context_source_registration_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Context Source Registration - RETURN ${response} - -Update Context Source Registration - [Arguments] ${context_source_registration_id} ${update_fragment} - - ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - ... json=${update_fragment} - ... expected_status=any - Output ${response} Update Context Source Registration - RETURN ${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} - ... ${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} - 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}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Context Source Registrations - RETURN ${response} - -Delete Context Source Registration - [Arguments] ${context_source_registration_id} - - ${response}= DELETE url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output ${response} Delete Context Source Registration - RETURN ${response} - -Retrieve Context Source Registration - [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}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - ... headers=${headers} - ... expected_status=any - Output ${response} Retrieve Context Source Registration - RETURN ${response} - -Create Context Source Registration Subscription - [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - - &{headers}= Create Dictionary Content-Type=${content_type} - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= POST - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... json=${subscription_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Context Source Registration Subscription - RETURN ${response} - -Update Context Source Registration Subscription - [Arguments] ${subscription_id} ${subscription_update_fragment} - - ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... json=${subscription_update_fragment} - ... expected_status=any - Output ${response} Update Context Source Registration Subscription - RETURN ${response} - -Retrieve Context Source Registration Subscription - [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}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... headers=${headers} - ... expected_status=any - Output ${response} Retrieve Context Source Registration Subscription - RETURN ${response} - -Query Context Source Registration Subscriptions - [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}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Context Source Registration Subscriptions - RETURN ${response} - -Delete Context Source Registration Subscription - [Arguments] ${subscription_id} - - ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output ${response} Delete Context Source Registration Subscription - RETURN ${response} - -Update Context Source Registration Subscription From File - [Arguments] ${subscription_id} ${file_path} - ${file_content}= Get File ${EXECDIR}/data/${file_path} - ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... data=${file_content} - ... expected_status=any - Output ${response} Update Context Source Registration Subscription From File - RETURN ${response} - -Create Subscription - [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}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} - ... json=${subscription} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Subscription - 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} - 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}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} - ... json=${subscription_payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Subscription From Subscription Payload - RETURN ${response} - -Create Subscription From File - [Arguments] ${filename} - ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Create Subscription From File - RETURN ${response} - -Update Subscription - [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}= PATCH - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... json=${subscription_update_fragment} - ... headers=${headers} - ... expected_status=any - Output ${response} Update Subscription - RETURN ${response} - -Update Subscription With Payload - [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}= PATCH - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... json=${payload} - ... headers=${headers} - ... expected_status=any - Output ${response} Update Subscription With Payload - RETURN ${response} - -Delete Subscription - [Arguments] ${subscription_id} - ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any - Output ${response} Delete Subscription - RETURN ${response} - -Query Subscriptions - [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}= GET - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Subscriptions - RETURN ${response} - -Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_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}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Output ${response} Retrieve Subscription - RETURN ${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 - 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}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Context Source Registrations - RETURN ${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 - 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}= GET - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... headers=${headers} - ... params=${params} - ... expected_status=any - Output ${response} Query Temporal Representation Of Entities - RETURN ${response} diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index 7a22bbdd856fe97e1ca585689a3282577fcbf67f..86ae646174403b0914df6c10b329b639f166ccc9 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -83,7 +83,7 @@ Batch Create Entities RETURN ${response} Batch Delete Entities - [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False + [Arguments] ${entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ... url=${url}/${BATCH_DELETE_ENDPOINT_PATH} @@ -204,16 +204,12 @@ Delete Entity Attributes Delete Entity by Id [Arguments] ${id} - ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any + ${response}= DELETE + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} + ... expected_status=any Output ${response} Delete Entity by Id RETURN ${response} -Delete Entity by Id Returning Response - [Arguments] ${id} - ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any - Output ${response} Delete Entity by Id Returning Response - RETURN ${response} - Partial Update Entity Attributes [Arguments] ... ${entityId} diff --git a/resources/ApiUtils/ContextInformationSubscription.resource b/resources/ApiUtils/ContextInformationSubscription.resource index 38a5fa934f1ecc08ccedd945c0d2800515b074b1..268e90a8831d8166105e18abb2ce35de49c7fb78 100755 --- a/resources/ApiUtils/ContextInformationSubscription.resource +++ b/resources/ApiUtils/ContextInformationSubscription.resource @@ -85,7 +85,9 @@ Create Subscription From Subscription Payload Delete Subscription [Arguments] ${subscription_id} - ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any + ${response}= DELETE + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... expected_status=any Output ${response} Delete Subscription RETURN ${response} @@ -126,7 +128,10 @@ Retrieve Subscription ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any + ${response}= GET + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} + ... headers=${headers} + ... expected_status=any Output ${response} Retrieve Subscription RETURN ${response} diff --git a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource index 8607ca4ab267f02dec77c354918bfda303f0bb3b..46e67e9815a707554401bdae2faf1c6dbbca2bd7 100755 --- a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource +++ b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource @@ -39,7 +39,8 @@ Create Context Source Registration Subscription Delete Context Source Registration Subscription [Arguments] ${subscription_id} - ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= DELETE + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Output ${response} Delete Context Source Registration Subscription RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index a21989e9ef9c240ae6c57f0bb43ac1bd51ee61f4..d901cd74007615ba9adf857b1bea6ab79b1e5c0f 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -4,6 +4,7 @@ Library RequestsLibrary Library Collections Library JSONLibrary Library String +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource *** Variables *** @@ -413,3 +414,12 @@ Check SUT Not Containing Resource Check SUT Not Containing Resources [Arguments] ${response_body} Should Be Empty ${response_body} + +Check Retrieving Context Source Registration + [Arguments] ${registration_id} ${context} ${accept} ${registration_payload} + ${response}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + ... context=${context} + ... accept=${accept} + ${ignored_attributes}= Create List ${status_regex_expr} @context + Check Updated Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} diff --git a/resources/variables.py b/resources/variables.py index 7b310bc52723b7d65084b9bd2bfd6dd08147e084..1c3b2ef5e70d571d57ea82656ab629324249eea5 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -5,3 +5,8 @@ notification_server_host = '0.0.0.0' notification_server_port = 8085 context_source_host = '0.0.0.0' context_source_port = 8086 + +# GitHub repository details +github_owner = 'your_github_username' +github_broker_repo = 'context_broker_repository' +github_token = 'your_github_token' diff --git a/tsm b/tsm new file mode 100755 index 0000000000000000000000000000000000000000..475f55c789c7533fa7a43c8c3f1e60abc3ddaa4f --- /dev/null +++ b/tsm @@ -0,0 +1,600 @@ +#!/usr/bin/env python + +# Documentation +# https://kislyuk.github.io/argcomplete/ +# +# + +# +# Installation +# pip install argcomplete +# activate-global-python-argcomplete +# +# +# In global completion mode, you don’t have to register each argcomplete-capable executable separately. +# Instead, the shell will look for the string PYTHON_ARGCOMPLETE_OK in the first 1024 bytes of any +# executable that it’s running completion for, and if it’s found, follow the rest of the argcomplete +# protocol as described above. +# +# Additionally, completion is activated for scripts run as python