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..d4e60cbaf0cef416524b791a5bcd77ba543331df --- /dev/null +++ b/.idea/runConfigurations/Generate_Documentation_Data.xml @@ -0,0 +1,25 @@ + + + + + \ 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..c7d52cccfc782d72cc6a471119eebfc623b2a2ce 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,20 @@ 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 execution results of the Test +Case with a specific Robot Listener class to automatically generate a GitHub Issue in the GitHub repository of the +Context Broker of a failed Test Case. In case that you cannot or do not want to 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 or there is an issue with the same name, but it is not closed. + +In order to create these issues, the [GitHub REST API](https://docs.github.com/en/rest) is used. For this purpose, +the authentication process is using a personal access token. The needed variables 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 +114,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``` @@ -131,10 +145,107 @@ test launch command followed by the file name. > > .venv\scripts\deactivate.bat > ``` +## Test Suite Management (tsm) + +The `tsm` script is designed to facilitate the selection and execution of the Test Suite, especially if not all the +endpoints of the API have been implemented for a specific Context Broker. This script provides a set of commands +to enable or disable Test Cases, Robot Test Suites or Collections (Robot Test Suite Groups), visualize the current +status of the different Test Cases, execute the selected Test Cases and perform other related operations as described +below. + +The `tsm` script generates a pickle file named `tsm.pkl`, which stores the tuples list corresponding to each Test Case +with the following information: + + (switch, running status, Test Case long name) + +where the values and their meaning are the following: +* **switch**: + * `ON`: the Test Case is on, which means that it will be executed by the script. + * `OFF`: the Test Case is off, and therefore is not selected to be executed by the script. + * `MISSING`: the Test Case is not anymore in the Test Suite Structure. An update operation should be run to update + the `tsm.pkl` with the current set of available Test Cases in the filesystem. + * `NEW`: new Test Case discovered by the tsm after an update operation. +* **status**: + * `PASSED`: the robot framework executes the Test Case with result PASS. + * `FAILED`: the robot framework executes the Test Case with result FAIL. + * `PENDING`: the Test Case is pending to be executed by the robot framework. +* **test case long name**: the Test Case long name set by robot framework based on the Robot Test Suite number and +the Test Case name (e.g., NGSILD.032 02.032_02_01 Delete Unknown Subscription) + +### Installation +The `tsm` script is integrated with arguments auto-completion for bash, therefore it is needed the installation of +the argcomplete python package on your system: + + pip install argcomplete + +and to enable the completion after the installation executing the following command: + + activate-global-python-argcomplete + +and then + + eval "$(register-python-argcomplete tsm)" + +Now, it is possible to autocomplete the commands and show possible options executing the script. Also –help argument +is available to obtain more information about the options. + +### Execution + +The tsm cases update command updates the `tsm.pkl` file with all the Robot Test Suite under the local path. If the +pickle file does not exist, it is created. After the creation of this file, it is possible to execute the script +to maintain and run the selected Test Cases from the pickle file. The list of commands is the following: + +* **Test Cases (cases)** + * Switch ON Test Cases + + tsm cases on [test_cases] + + * Switch OFF Test Cases + + tsm cases off [test_cases] + tsm cases off "NGSILD.032 01.032_01_02 InvalidId" + + * List Test Cases based on the specific flag. + + tsm cases list [on, off, missing, new, passed, failed, pending, all] + tsm cases list ./TP/NGSI-LD/CommonBehaviours + + * Run Test Cases that are enabled + + tsm cases run [on, off, missing, new, passed, failed, pending, [test_cases]] + tsm cases run NGSILD.048\ 01.048_01_06\ Endpoint\ post\ /temporal/entities/ + tsm cases run pending + + * Update the pickle file with the current Test Cases + + tsm cases update + + * Clean Test Cases, remove the Test Cases that were marked as MISSING + + tsm cases clean + +* **Robot Test Suites (suites)** + * Switch ON Robot Test Suites + + tsm suites on [suites] + + * Switch OFF Robot Test Suites + + tsm suites off [suites] + +* **Test Collections (collections)** + * Switch ON Test Collections + + tsm collections on [collections] + tsm collections on ./TP/NGSI-LD/CommonBehaviours + + * Switch OFF Test Collections + + tsm collections off [collections] ## Contribute to the Test Suite -In order to contribute to the ETSI NGSI-LD Test Suite, you recommend the installation of an IDE with the corresponding +In order to contribute to the ETSI NGSI-LD Test Suite, it is recommended to install an IDE with the corresponding Robot Framework. Our recommendations are: - PyCharm @@ -146,10 +257,109 @@ 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}/ngsi-ld-test-suite"}`. + +### Develop a new Test Case + +In order to develop a new Test Case, some rules and conventions have to be followed. + +#### Test Case Template + +The following template shows the typical structure of a Test Case. It can be used as a template when creating a new +Test Case. + +``` +*** Settings *** +Documentation {Describe the behavior that is being checked by this Test Case} + +Resource ${EXECDIR}/resources/any/necessary/resource/file + +# For both setup and teardown steps, try as possible to use Keyword names already declared in doc/analysis/initial_setup.py +Suite Setup {An optional setup step to create data necessary for the Test Case} +Suite Teardown {An optional teardown step to delete data created in the setup step} +Test Template {If the Test Case uses permutations, the name of the Keyword that is called for each permutation} + + +*** Variables *** +${my_variable}= my_variable +*** Test Cases *** PARAM_1 PARAM_2 +XXX_YY_01 Purpose of the first permutation + [Tags] {resource_request_reference} {section_reference_1} {section_reference_2} + param_1_value param_2_value +XXX_YY_02 Purpose of the second permutation + [Tags] {resource_request_reference} {section_reference_1} {section_reference_2} + param_1_value param_2_value + + +*** Keywords *** +{Keyword name describing what the Test Case is doing} + [Documentation] {Not sure this documentation brings something?} + [Arguments] ${param_1} ${param_2} + + # Call operation that is being tested, passing any needed argument + + # Perform checks on the response that has been received from the operation + + # Optionally call another endpoint to do extra checks (e.g. check an entity has really been created) + +# Add there keywords for setup and teardown steps +# Setup step typically creates data necessary for the Test Case and set some variables that will be used by the Test Case +# using Set Suite Variable or Set Test Variable keywords +# Teardown step must delete any data that has been created in setup step +``` + +Where : + +- The possible values for `{resource_request_reference}` are defined in DGR/CIM-0015v211, section 6.1 +- The meaning of the `{section_reference_x}` tags is defined in DGR/CIM-0015v211, section 6.2. A Test Case can reference + more than one section in the specification (for instance, a Test Case whose goal is to check that scopes are correctly + created when an entity is created should reference sections 4.18 NGSI-LD Scopes and 5.6.1 Create Entity of the + RGS/CIM-009v131 document) + +#### Generate the documentation + +The Conformance Tests include an option to automatically generate the documentation of them. If new tests are developed +but include the Check and Request operations already defined, it is not needed to modify the automatic generation system. +Nevertheless, if there are new operations to check and/or new request operations to develop in the Conformance Tests, +it is needed to describe them so that the automatic documentation generated covers these new operations. + +Additionally, there is defined a Unit Test mechanism to identify if new Test Suites are included in the system +(See `doc/tests/test_CheckTests.py`) and if there were some changes in any Test Suite (See the `doc/tests/other test_*.py`). +In these cases, it is needed to provide the corresponding information in the Python code: + +- When a new Test Case is created, it has to be declared in the corresponding `doc/tests/test_{group}.py` Python file + (where `{group}` represents the group of operations and how they are defined in the ETSI RGS/CIM-0012v211 document). + Complementary to this, updates have to be done: + - In `doc/analysis/initial_setup.py` if it uses a new keyword to set up the initial state of the Test Case + - In `doc/analysis/requests.py` if it updates an endpoint operation, for instance by adding support for a new request + parameter (in `self.op` with the list and position of parameters, in the method that pretty prints the operation in + the automated generation of the documentation associated with the Test Cases. If the positions array is empty, it + means that all the parameters will be taken into consideration) + - Run the documentation generation script (`python doc/generateDocumentationData.py {new_tc_id}`) for the new Test + Case and copy the generated JSON file in the folder containing all files for the given group and subgroup + (`cp doc/results/{new_tc_id}.json doc/files/{group}/{subgroup}`) +- When a new global Keyword is created, it has to be declared in the corresponding Python files: + - In `doc/analysis/checks.py` if it is an assertion type keyword (in `self.checks` to reference the method that pretty + prints the operation and `self.args` to identify the position of the arguments) and the corresponding method to + provide the description of this new operation + - In `doc/analysis/requests.py` if it is an endpoint operation (in `self.op` with the list and position of parameters, + in `self.description` to reference the method that pretty print the operation, and add the method that pretty prints + the operation) +- When a new permutation is added in an existing Test Case, run the documentation generation script + (`python doc/generateDocumentationData.py {tc_id}`) for the Test Case and copy the generated JSON file in the + folder containing all files for the given group and subgroup (`cp doc/results/{tc_id}.json doc/files/{group}/{subgroup}`) +- When a new directory containing Test Cases is created, it has to be declared in `doc/generaterobotdata.py` along with + its acronym + +Finally, check that everything is OK by running the unit tests: + +```shell +python -m unittest discover -s ./doc/tests -t ./doc +``` + ### Run configurations (PyCharm) Two sample configurations have been created: @@ -225,7 +435,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 you want to execute the test suite number 043 and generate the report, you 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..04e4af9f05f9bd2cfb8c5898c106395d884f81d4 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyGETWithoutAccept/045_01.robot @@ -29,26 +29,31 @@ ${content_type}= application/json *** Test Cases *** 045_01_01 Endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) - [Tags] e-query 6_3_4 + [Tags] e-query cb-get 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${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}) - [Tags] sub-retrieve 6_3_4 + [Tags] sub-retrieve cb-get 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_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} @@ -56,7 +61,7 @@ ${content_type}= application/json 045_01_03 Endpoint /csourceRegistrations/ [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) - [Tags] csr-query 6_3_4 + [Tags] csr-query cb-get 6_3_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} @@ -74,12 +79,12 @@ ${content_type}= application/json 045_01_04 Endpoint /temporal/entities [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) - [Tags] te-query 6_3_4 + [Tags] te-query cb-get 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..44a8ff105f12187067e96ea084e89d4309260ca8 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot @@ -24,7 +24,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration *** Test Cases *** 043_01_01 Create entity [Documentation] Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) - [Tags] e-create 5_2_2 + [Tags] e-create cb-ldcontext 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Create Entity Selecting Content Type ... ${building_filename} @@ -39,7 +39,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration 043_01_02 Create subscription [Documentation] Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription) - [Tags] sub-create 5_2_2 + [Tags] sub-create cb-ldcontext 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} @@ -51,12 +51,12 @@ ${registration_filename}= csourceRegistrations/context-source-registration 043_01_03 Create Temporal Representation of Entities [Documentation] Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) - [Tags] te-create 5_2_2 + [Tags] te-create cb-ldcontext 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()} @@ -66,7 +66,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration 043_01_04 Batch entity create [Documentation] Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create) - [Tags] be-create 5_2_2 + [Tags] be-create cb-ldcontext 5_2_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${building_filename} ${first_entity_id} @@ -79,11 +79,11 @@ ${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) - [Tags] csr-create 5_2_2 + [Tags] csr-create cb-ldcontext 5_2_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_01.robot index c405da48846078ba717a24a55519990b2198faf9..af2fbf781b7dd9a90dabdd0515a2a2297f77f6ef 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 + [Tags] ea-partial-update cb-mergepatch 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/VerifyMergePatchJson/044_02.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_02.robot index 9dbb718367c899c129146d1d2eb4f73dd4b2ae43..a228f94b80facdde3ade8ba78791e611645fc781 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyMergePatchJson/044_02.robot @@ -19,7 +19,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp *** Test Cases *** 044_02_01 Endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] sub-update 6_3_4 + [Tags] sub-update cb-mergepatch 6_3_4 ${response}= Update Subscription ... ${subscription_id} ... ${subscription_fragment} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot index c234fad7301ec25bf91e7b048d727619df11981c..b835ad1c5209de29d663a3bb376efed9f34d228b 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_01.robot @@ -21,35 +21,39 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: *** Test Cases *** 049_01_01 Endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) - [Tags] e-query 6_3_4 + [Tags] e-query cb-noacceptable-medtype 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 + [Tags] sub-retrieve cb-noacceptable-medtype 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_01_03 Endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - [Tags] csr-query 6_3_4 + [Tags] csr-query cb-noacceptable-medtype 6_3_4 ${response}= Query Context Source Registrations With Return type=Building accept=${accept} Check Response Status Code ${status_code} ${response.status_code} 049_01_04 Endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) - [Tags] csrsub-query 6_3_4 + [Tags] csrsub-query cb-noacceptable-medtype 6_3_4 ${response}= Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code ${status_code} ${response.status_code} 049_01_05 Endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - [Tags] te-query 6_3_4 + [Tags] te-query cb-noacceptable-medtype 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot index 2b5ac9bd003ee6fe7c37339ea351a2849374ad08..75a726425014499e2e60454d298ab9f02029f2e7 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyNotAcceptableMediaType/049_02.robot @@ -17,15 +17,16 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: *** Test Cases *** 049_02_01 Retrieve subscription by id [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 + [Tags] sub-retrieve cb-noacceptable-medtype 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) - [Tags] te-query 6_3_4 + [Tags] te-query cb-noacceptable-medtype 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} @@ -36,6 +37,6 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: 049_02_03 Query context source registration [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 /csourceRegistrations) - [Tags] csr-query 6_3_4 + [Tags] csr-query cb-noacceptable-medtype 6_3_4 ${response}= Query Context Source Registrations With Return type=Building accept=${accept} Check Response Status Code ${status_code} ${response.status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot index fbd9c87f7312808be977a9d17eca32f00dc804b6..9b0dd21246fbbd5b0af99d9865334d620befa5e0 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyUnsupportedMediaType/048_01.robot @@ -26,19 +26,19 @@ ${content_type}= application/xml *** Test Cases *** 048_01_01 Endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) - [Tags] ea-partial-update 6_3_4 + [Tags] ea-partial-update cb-unsupport-medtype 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}) - [Tags] sub-update 6_3_4 + [Tags] sub-update cb-unsupport-medtype 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} Check Response Status Code 415 ${response.status_code} @@ -46,7 +46,7 @@ ${content_type}= application/xml 048_01_03 Endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) - [Tags] e-create 6_3_4 + [Tags] e-create cb-unsupport-medtype 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Create Entity Selecting Content Type ... ${building_filename} @@ -57,7 +57,7 @@ ${content_type}= application/xml 048_01_04 Endpoint post /subscriptions/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) - [Tags] sub-create 6_3_4 + [Tags] sub-create cb-unsupport-medtype 6_3_4 ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} Check Response Status Code 415 ${response.status_code} @@ -65,7 +65,7 @@ ${content_type}= application/xml 048_01_05 Endpoint post /entityOperations/create [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) - [Tags] be-create 6_3_4 + [Tags] be-create cb-unsupport-medtype 6_3_4 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${building_filename} ${first_entity_id} @@ -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 + [Tags] te-create cb-unsupport-medtype 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/QueryEntities/019_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot new file mode 100644 index 0000000000000000000000000000000000000000..73484e24301bec660e34cb129e241048c3d8838c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results. + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query Entities With Count + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${first_entity_filename}= building-simple-attributes-sample.jsonld +${second_entity_filename}= building-simple-attributes-second-sample.jsonld +${entity_type}= Building +${airQualityLevel}= airQualityLevel==6 + + +*** Test Cases *** Q_PARAMETER EXPECTED_STATUS EXPECTED_COUNT +019_07_01 Check that the total number of matching results is returned if the count parameter is set to true and only the entity type is provided + ${EMPTY} 200 2 +019_07_02 Check that the total number of matching results is returned if the count parameter is set to true and a q parameter is provided + ${airQualityLevel} 200 1 + + +*** Keywords *** +Query Entities With Count + [Documentation] If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results. + [Tags] e-query 5_7_2 6_3_13 + [Arguments] ${q} ${expected_status_code} ${expected_count} + ${response}= Query Entities + ... entity_types=${entity_type} + ... q=${q} + ... count=${True} + ... context=${ngsild_test_suite_context} + + Check Response Status Code ${expected_status_code} ${response.status_code} + Check Response Headers Containing NGSILD-Results-Count Equals To ${expected_count} ${response.headers} + +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${create_response1}= Create Entity Selecting Content Type + ... ${first_entity_filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + 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} + ${create_response2}= Create Entity Selecting Content Type + ... ${second_entity_filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} + +Delete Initial Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_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/QueryTemporalEvolutionOfEntities/021_14.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot new file mode 100644 index 0000000000000000000000000000000000000000..d18dd087a3dca0d387c1f0ed165c9d89d291cc0a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities with the simplified representation + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + + +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +021_14_01 After + [Tags] te-query 5_7_4 + after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-14-01-expectation.json +021_14_02 Before + [Tags] te-query 5_7_4 + before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-14-02-expectation.json + + +*** Keywords *** +Query the temporal evolution of entities + [Documentation] Check that you can query the temporal evolution of entities with the simplified representation + [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} + ... context=${ngsild_test_suite_context} + ... options=temporalValues + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + ... ${response.json()} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${bus_payload_file} + ... ${third_temporal_entity_representation_id} + Set Test Variable ${first_temporal_entity_representation_id} + Set Test Variable ${second_temporal_entity_representation_id} + Set Test Variable ${third_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + 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/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..97507d6f6e1ac7f170670510113ac8c4de5047c5 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_02 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..e32113286837dcd5bf6af9328d6b7a1c2d634da9 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,45 @@ 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 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} + ${response}= Delete Entity Attributes + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... datasetId=${EMPTY} + ... deleteAll=false + Check Response Status Code ${expected_status_code} ${response.status_code} + +Create Initial Entity + ${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} + Check Response Status Code 201 ${create_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/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..241a0712006201bf8cf794e367d06f7ec368cdfc --- /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 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..bfe466ea3881660adb00a8850b4e6e45488dc380 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -7,8 +7,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Create Id -Test Teardown Delete Intitial Temporal Representation Of Entity -Test Template Delete Attribute Instance +Test Teardown Delete Initial Temporal Representation Of Entity +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} @@ -57,5 +57,5 @@ Create Id ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Test Variable ${valid_instanceId} -Delete Intitial Temporal Representation Of Entity +Delete Initial Temporal Representation Of Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot 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/CreateSubscription/028_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..9602eff7d2a1364df2395fc7b11ef9995763a2ff --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_05.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you cannot create a subscription with invalid throttling + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Subscription With Invalid Throttling + + +*** Test Cases *** FILENAME EXPECTED_STATUS +028_05_01 ThrottlingAndTimeIntervalConjunction + subscription-invalid-throttling-timeInterval-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} +028_05_02 NegativeThrottling + subscription-invalid-negative-throttling-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + + +*** Keywords *** +Create Subscription With Invalid Throttling + [Documentation] Check that you cannot create a subscription with invalid throttling + [Tags] sub-create 5_8_1 + [Arguments] ${filename} ${expected_status} + ${response}= Create Subscription From File ${filename} + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${expected_status} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.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..aebf283097ac0dfb438a6b189d0f100071b0d4c7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot @@ -23,14 +23,13 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Test Cases *** 046_01_01 Check that a notification is only sent if status is active [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_8_6 046_01 + [Tags] sub-notification 5_8_6 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..9fb9e494660a117b7cd6d30cd0004c56ce52b5b8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot @@ -22,11 +22,8 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld *** Test Cases *** 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 + [Tags] sub-notification 5_8_6 + ${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..b8cb874b07fe001f38def9bcfaf15f11aaba2bd8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot @@ -23,11 +23,8 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 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 + [Tags] sub-notification 5_8_6 + ${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..3e487cafebd90b13387854e99968dbb68700c1d8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot @@ -23,12 +23,10 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 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 + [Tags] sub-notification 5_8_6 + ${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,31 @@ ${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..b698a8c25f1d6a374d4f37bdc95f4e7eb931bd81 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot @@ -23,12 +23,10 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 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 + [Tags] sub-notification 5_8_6 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..021d8432be0ec71a271ffc6314fd04c03d70a54c 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. - [Tags] sub-notification 5_8_6 046_06 - ${entity_building}= Create Entity Selecting Content Type + [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. + [Tags] sub-notification 5_8_6 + ${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..cbba2962734a6f85029e5c383ce1de115af987d3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot @@ -7,62 +7,59 @@ 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 *** -${subscription_id_prefix} urn:ngsi-ld:Subscription: -${subscription_payload_file_path} subscriptions/subscription-building-entities-active.jsonld -${subscription_payload_file_path_watchedAttributes} subscriptions/subscription-building-entities-active-watchedAttributes.jsonld -${subscription_payload_file_path_default_context} subscriptions/subscription-building-entities-active-default-context.jsonld -${building_id_prefix} urn:ngsi-ld:Building: -${notification_server_send_url} http://${notification_server_host}:${notification_server_port}/notify -${entity_building_filepath} building-simple-attributes-sample.jsonld -${fragment_filename} airQualityLevel-fragment.jsonld -${date_format} %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path_notificationAttributes} subscriptions/subscription-building-entities-active-notificationAttributes.jsonld +${subscription_payload_file_path_default_context} subscriptions/subscription-building-entities-active-default-context.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${notification_server_send_url} http://${notification_server_host}:${notification_server_port}/notify +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${date_format} %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ *** Test Cases *** 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} + [Tags] sub-notification 5_8_6 + [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} + [Tags] sub-notification 5_8_6 + [Setup] Setup Initial Subscriptions ${subscription_payload_file_path_notificationAttributes} + + ${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} + Dictionary Should Not Contain Key ${notification}[data][0] name 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} + [Tags] sub-notification 5_8_6 + [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 +67,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..3e685e6224da6de7b58b963c3cb171717ec36d18 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 + [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 + [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..359b126ccd57effa546b16a4433b2ed8765e315b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.receiverInfo defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource @@ -22,45 +22,44 @@ ${notification_server_send_url} http://${notification_server_host}:${not *** Test Cases *** 046_09_01 Check that a notification is sent to the endpoint - [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.1 - [Tags] sub-notification 5_8_6 046_09 + [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.receiverInfo 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 - 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..31866d310216a7371be5c2d468611bb4ca233f65 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot @@ -24,47 +24,45 @@ ${expected_header_links} <${ngsild_test_suite_context}>; rel="htt *** Test Cases *** 046_10_01 Check that the notification is sent as JSON [Documentation] The Notification shall be sent as JSON - [Tags] sub-notification 5_8_6 046_10 + [Tags] sub-notification 5_8_6 - 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..f8b2d391902549cf325d1570566255e6bd9d0c1e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot @@ -25,7 +25,7 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ *** Test Cases *** 046_11_01 Check that timesSent is increased by one [Documentation] The notification.timesSent member shall be incremented by one. - [Tags] sub-notification 5_8_6 046_11 + [Tags] sub-notification 5_8_6 Add Initial Entity Sleep 1s @@ -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..bacdb570e68d875e42531193233b8ae241bd435a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot @@ -23,7 +23,7 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Test Cases *** 046_12_01 Check that lastNotification is updated [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. - [Tags] sub-notification 5_8_6 046_12 + [Tags] sub-notification 5_8_6 Add Initial Entity Sleep 1s @@ -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..ccc6ef86c8fa3e6d72a3ff884b5bca2f98bc3c06 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot @@ -23,7 +23,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 046_13_01 Check that lastFailure and status are updated if a notification could not be sent [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed" - [Tags] sub-notification 5_8_6 046_13 + [Tags] sub-notification 5_8_6 @{expected_notification_data_entities}= Create List Building Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -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..b5258eb652207f473d502666afb99e8d4ba0bd98 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 - [Tags] sub-notification 5_8_6 046_14 + [Documentation] The Notification content shall be JSON-LD when endpoint.accept is set to 'application/ld+json' + [Tags] sub-notification 5_8_6 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/SubscriptionNotificationBehaviour/046_15.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot new file mode 100644 index 0000000000000000000000000000000000000000..c1661f987e76cf97b4fcfd281836db793e96faee --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot @@ -0,0 +1,67 @@ +*** Settings *** +Documentation If a Subscription defines a throttling member, a Notification shall not be sent if the throttling specified (in seconds) has not elapsed yet. + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-valid-throttling-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${notification_server_host}:${notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** +046_15_01 Check that a notification is not sent if the throttling has not elapsed yet + [Documentation] If a Subscription defines a throttling member, a Notification shall not be sent if the throttling specified (in seconds) has not elapsed yet. + [Tags] sub-notification 5_8_6 + Setup Initial Subscriptions + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification} ${headers}= Wait for notification timeout=${10} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for no notification + + +*** 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} + 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} + +Delete Initial Entity + Delete Entity by Id ${entity_id} 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..2bc317bbd8a6a2bcec6ed701a838812592c45cbe 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 *** @@ -20,14 +20,14 @@ ${second_context_source_registration_payload_file_path}= csourceRegistrations *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS 037_01_01 With list of entity types [Tags] csr-query 5_10_2 - type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} + type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} 037_01_02 With list of attribute names [Tags] csr-query 5_10_2 attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} *** Keywords *** -Query Context Source Registration +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_03.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_03.robot index a0faf22d73e9d62328e6f96aa6ec168ab9f2df91..0740c46bcffd679b0067cd35c32725674b1276aa 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_03.robot @@ -14,7 +14,7 @@ Test Template Query Context Source Registration With Invalid Query Param id invalidUri 037_03_02 Invalid Query [Tags] csr-query 5_10_2 - q invalidQuery + q (invalidQuery 037_03_03 Invalid GeoQuery [Tags] csr-query 5_10_2 georel within diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot index cfb155833227452447e126167330c7f710447be0..7856534fa6746497bac4413d742dd319e431ab9f 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot @@ -31,12 +31,12 @@ 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 - ... attrs=name + ... type=OffStreetParking + ... idPattern=.*downtown$ @{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_07.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot index b544645521282dba9c07762548033b9ad73dccb2..9c1aaf8d1a04a6cad05811cb978f3dbdd4a5f4a8 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot @@ -18,9 +18,11 @@ ${expectation_file_path}= csourceRegistrations/exp *** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH -037_07_01 Near Point [Tags] csr-query 5_10_2 +037_07_01 Near Point + [Tags] csr-query 5_10_2 near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} -037_07_02 Within Polygon [Tags] csr-query 5_10_2 +037_07_02 Within Polygon + [Tags] csr-query 5_10_2 within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} 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..be3044f4b168d115592b5d9998dece4d11a43d8a 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Created Context Source Registrations +Test Teardown Delete Created Context Source Registrations Test Template Query Context Source Registration Matching Temporal Query @@ -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/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot index 22e2d1845d80ff04ad8a688e6c7438edc0d1140b..cf87f23264aa588aa99f7a7b4a60b3142f7e9e08 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot @@ -15,19 +15,16 @@ Test Template Query Context Source Registration With Query Params ${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: ${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-csourceProperty-sample.jsonld *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS 037_10_01 With list of Entity Ids [Tags] csr-query 5_10_2 - id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} + id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id},${third_context_source_registration_id} 037_10_02 With NGSI-LD Query [Tags] csr-query 5_10_2 - q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} -037_10_03 With Context Source Filter - [Tags] csr-query 5_10_2 - csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + q csourceProperty1=="aValue" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot index 9fd5f98730ed263cc26094e95b5d840021bff558..42da3269d92a9b68fe320c640f66b2a9e5a3d843 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.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 With Limit And Page Parameters +Test Template Query Context Source Registration With Limit And Offset Parameters *** Variables *** @@ -18,27 +18,27 @@ ${second_context_source_registration_payload_file_path}= csourceRegistrations ${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK +*** Test Cases *** LIMIT OFFSET EXPECTED_NUMBER PREV_LINK NEXT_LINK 037_11_01 Query Second Subscription [Tags] csr-query 5_10_2 - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" 037_11_02 Query Last Subscription [Tags] csr-query 5_10_2 - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} 037_11_03 Query All Subscriptions [Tags] csr-query 5_10_2 - ${15} ${1} ${3} ${EMPTY} ${EMPTY} + ${15} ${0} ${2} ${EMPTY} ${EMPTY} *** Keywords *** -Query Context Source Registration With Limit And Page Parameters +Query Context Source Registration With Limit And Offset Parameters [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. - [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} + [Arguments] ${limit} ${offset} ${expected_number} ${prev_link} ${next_link} ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... limit=${limit} - ... page=${page} + ... offset=${offset} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ... ContextSourceRegistration diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot index 35acf4076bdf03862f4e7d4930dbac9dc54a278a..b0a321ae10e57ea9dcc3ce8fa36aad57947b6384 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_01.robot @@ -1,25 +1,25 @@ *** Settings *** -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 +Documentation Check that you cannot retrieve a Context Source Registration, if the context source registration id is not a valid URI Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id +Test Template Retrieve Context Source Registration With An Invalid Id *** Test Cases *** ID -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_01 Invalid Id + [Tags] csr-retrieve 5_10_1 invalidUri *** Keywords *** -Retrieve Context Source Registration With A Not Present Or Invalid Id - [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI +Retrieve Context Source Registration With An Invalid Id + [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id 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..6ec5936d178d0b49e2a2742a0e1903bfda27de76 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -5,38 +5,45 @@ 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 +*** Test Cases *** INVALID_REGISTRATION_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 035_02_01 Delete a Context Source Registration if the Id is not present [Tags] csr-delete 5_9_4 - ${EMPTY} + ${EMPTY} 405 ${EMPTY} 035_02_02 Delete a Context Source Registration if the Id is not a valid URI [Tags] csr-delete 5_9_4 - invalidURI + invalidURI 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** 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} + [Arguments] ${invalid_registration_id} ${expected_status_code} ${problem_type} + ${response}= Delete Context Source Registration With Return ${invalid_registration_id} + 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 + +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} - ${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} 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..bba76343bba3d32e8eb6876357be7cfb70bdefda 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot @@ -15,21 +15,22 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_01_03 Create Context Source Registration Without A Sprecified ID +033_01_03 Create Context Source Registration Without Specifying an 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} + ${id_dict}= Create Dictionary id=${registration_id} + ${registration_payload}= Add Object To Json ${payload} $ ${id_dict} + ${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..3010951f0801a0b2c34a8d32c16a06fcfb702f52 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_07.robot @@ -15,24 +15,42 @@ ${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} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${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} - ${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'] - ... https://ngsi-ld-test-suite/context#Building - ... ${response.json()} + ... Vehicle + ... ${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#Vehicle + ... ${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..80d52d135964076747a314a1fb2cc05745525195 --- /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 CSourceRegistration 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..28d67a239951076caf5b22edcda85c6b32be55f9 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 *** @@ -17,35 +18,37 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_01_01 Update a context source registration by id [Tags] csr-update 5_9_3 - 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-sample.jsonld context-source-registration-update-sample.json *** 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} - ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} - ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} + Set Test Variable ${filename} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} + ${registration_update_fragment}= Update Value To JSON ${fragment} $.id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${registration_update_fragment} - ... ${CONTENT_TYPE_LD_JSON} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} - ${response}= Retrieve Context Source Registration - ... ${registration_id} - ... context=${ngsild_test_suite_context} - ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + Check JSON Value In Response Body + ... ['endpoint'] + ... http://my.new.csource.org:1026 + ... ${response1.json()} 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/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..ec408e9cbb037e0370fa122e7886ae009e897b44 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -5,73 +5,49 @@ 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 +${reason_400}= Bad Request -*** 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 - -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 - -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 +*** Test Cases *** REGISTRATION_ID FRAGMENT_FILENAME EXPECTED_STATUS_CODE PROBLEM_TYPE +034_02_01 Update a context source registration by id if the Id is not a valid URI + invalidURI fragments/context-source-registration-different-type-sample.jsonld 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +034_02_02 Update a context source registration if the request body is not of the same data type + ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +034_02_03 Update a context source registration if you attempt to remove a mandatory property + ${valid_registration_id} context-source-registration-invalid-sample.jsonld 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** -Update Context Source +Update A Context Source [Documentation] Check that you cannot update a context source registration under some conditions - [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} + [Tags] csr-update 5_9_3 + [Arguments] ${registration_id} ${fragment_filename} ${expected_status_code} ${problem_type} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} - ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} + ${fragment_with_id}= Update Value To JSON ${fragment} $.id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Context Source Registration ${valid_registration_id} + Check Response Status Code ${expected_status_code} ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_400} + Check Response Body Containing ProblemDetails Element ${response.json()} ${problem_type} -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..b27e8dd6e53f652fd57af757436b0b252715fca2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -5,30 +5,25 @@ 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 +${reason_404}= Not Found *** 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} - ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} + ${fragment_with_id}= Update Value To JSON ${fragment} $.id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - - -*** Keywords *** -Delete Updated Context Source Registration - Delete Context Source Registration ${registration_id} + Check Response Reason set to ${response.reason} ${reason_404} + Check Response Body Containing ProblemDetails Element ${response.json()} ${ERROR_TYPE_RESOURCE_NOT_FOUND} 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..faef017ac06b9a1f443d85b3e7ddf14af28e0d70 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_04.robot @@ -0,0 +1,42 @@ +*** 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-json-sample.json + + +*** 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 From File + ... ${registration_id} + ... ${registration_payload_file_path} + 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/Registration/UpdateContextSourceRegistration/034_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..4b04131f0d8872a5545ddd70d0e21a90ece6837c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_05.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that you can update a context source registration by id + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +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 A Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: + + +*** Test Cases *** FILENAME UPDATE_FILENAME +034_05_01 Update a context source registration to never expire + [Tags] csr-update 5_9_3 + context-source-registration-with-expiration-sample.jsonld context-source-registration-null-expiresAt.json + + +*** Keywords *** +Update A Context Source + [Documentation] Check that you can update a context source registration by id + [Arguments] ${filename} ${update_filename} + Set Test Variable ${filename} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} + ${registration_update_fragment}= Update Value To JSON ${fragment} $.id ${registration_id} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${registration_update_fragment} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response1}= Retrieve Context Source Registration + ... context_source_registration_id=${registration_id} + Check JSON Value Not In Response Body + ... $.expiresAt + ... ${response1.json()} + +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/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_06.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_06.robot new file mode 100644 index 0000000000000000000000000000000000000000..e4ceac334789b2510745641b01219bc91229aa42 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_06.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration if the Id is not present + +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 +Test Template Update A Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld +${reason_405}= Method Not Allowed + + +*** Test Cases *** FRAGMENT_FILENAME EXPECTED_STATUS_CODE REASON +034_06_01 Update a context source registration by id if the Id is not present + fragments/context-source-registration-different-type-sample.jsonld 405 ${reason_405} + + +*** Keywords *** +Update A Context Source + [Documentation] Check that you cannot update a context source registration under some conditions + [Tags] csr-update 5_9_3 + [Arguments] ${fragment_filename} ${expected_status_code} ${reason} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} + ${fragment_with_id}= Update Value To JSON ${fragment} $.id ${EMPTY} + ${response}= Update Context Source Registration With Return + ... ${EMPTY} + ... ${fragment_with_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response.status_code} + Check Response Reason set to ${response.reason} ${reason} + Check Response Does Not Contain Body ${response} + +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 ${valid_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 ${valid_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..db34b844b935b57325a256379deaac0516f8a96a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -22,12 +22,25 @@ ${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} + + # We need to ignore the Additional Members ('lastFailure', 'lastNotification', 'timesFailed', 'timesSent') + ${ignored_attributes}= Create List + ... ${status_regex_expr} + ... ${lastfailure_regex_expr} + ... ${lastNotification_regex_expr} + ... ${timesFailed_regex_expr} + ... ${timesSent_regex_expr} + + Check Created Resource Set To ${subscription_payload} ${response1.json()} ${ignored_attributes} + + Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastNotification + Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastFailure + Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastSuccess + Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} timesSent *** 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..fe198aac608ade0998f1d94ce482abab56957ebe 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -4,13 +4,13 @@ Documentation Check that you can create a context source registration subs Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistrationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/HttpUtils.resource Suite Teardown Delete Created Context Source Registration Subscriptions *** Variables *** ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id}= ${EMPTY} *** Test Cases *** @@ -18,19 +18,27 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} + Remove From Dictionary ${subscription_payload} id ${response}= Create Context Source Registration Subscription ${subscription_payload} - ${subscription_id}= Fetch Id From Response Location Header ${response.headers} - Check Response Status Code 201 ${response.status_code} - Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + + Dictionary Should Contain Key ${response.headers} Location msg=HTTP Headers do not contain key 'Location' + ${subscription_id}= Get From Dictionary ${response.headers} Location Set Suite Variable ${subscription_id} - ${response}= Retrieve Context Source Registration Subscription - ... ${subscription_id} + + Check Response Status Code 201 ${response.status_code} + + ${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 *** Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + IF "${subscription_id}" != "${EMPTY}" + Delete Context Source Registration Subscription ${subscription_id} + ELSE + Log To Console \nThere was no Context Source Registration Subscription to delete\n + END 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..e2fb5b4ffcca430be7c168dfcce229c57ec37099 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -22,8 +22,19 @@ ${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} + + # The conversion of a boolean data to json for a python object transform false -> False and true -> True + Check Response Body Containing a Boolean Attribute set to + ... expected_attribute_name=isActive + ... response_body=${response1.json()} + ... expected_attribute_value=False + + 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..18ed598f84c9ff588a6a6e637e6295dfa45c26ea 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -20,15 +20,25 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expire [Tags] csrsub-create 5_11_2 ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} - ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} + ${expiresAt}= Add Time To Date ${current_date} 10 seconds result_format=${date_format} ${subscription_payload}= Update Value To JSON ${subscription_payload_sample} $..expiresAt ${expiresAt} ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Sleep 15s - ${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 Contains DateTime Value + ... dictionary=${response1.json()} + ... key=expiresAt + ... expected value=${expiresAt} + + Check Response Body Containing an Attribute set to + ... expected_attribute_name=status + ... response_body=${response1.json()} + ... expected_attribute_value=expired *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions 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..e9cb913c2b2aa80e96c31aab9c8f2b6c425c2e0b 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 *** @@ -21,18 +21,17 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 409 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_ALREADY_EXISTS} *** 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..05e2da3120c9f7e1b5652bfca6efdbdefc224368 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 @@ -34,7 +36,6 @@ Create Invalid Context Source Registration Subscription ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index b3da65119f068dcd6b37bc25d99ad5ecdf3d7187..420689f22590a764667981b4c56acb3d5c81b7b4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -19,7 +19,6 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expire ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} 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..72bfb91d67897c965af29dc141c4cae38b2550e4 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 Subscriptions *** 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..dd52a0c7be27c767a8339ec9ee66ac8770d2b7d0 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,9 +40,9 @@ 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()} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.headers} Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_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..73d765937a7f426b389c5b68a404be26d6c1510a 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,13 +20,41 @@ ${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} + + ${expected_link_header}= CATENATE + ... SEPARATOR= + ... < + ... ${ngsild_test_suite_context} + ... >; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" + Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Subscription element - ... ${expectation_file_path} - ... ${subscription_id} - ... ${response.json()} + Check Response Reason set to ${response.reason} OK + Check Response Headers Link set to + ... response_headers=${response.headers} + ... expected_link_header=${expected link header} + + ${expectation_payload}= Load Test Sample ${expectation_file_path} ${subscription_id} + + # We need to ignore the Additional Members ('lastFailure', 'lastNotification', 'timesFailed', 'timesSent', 'isActive') + ${ignored_attributes}= Create List + ... ${status_regex_expr} + ... ${lastfailure_regex_expr} + ... ${lastNotification_regex_expr} + ... ${timesFailed_regex_expr} + ... ${timesSent_regex_expr} + ... ${is_active_expr} + + Check Created Resource Set To + ... created_resource=${expectation_payload} + ... response_body=${response.json()} + ... ignored_keys=${ignored_attributes} + + Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastNotification + Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastFailure + Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastSuccess + Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} timesSent *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index a6d73ef92a8451aca53a2332abb58cab7601b48e..38e117d9f0d0ef5bec1d81f35263776cb445417e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -10,9 +10,12 @@ 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()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Reason set to ${response.reason} Bad Request + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index e05523f7189f2e00893800d15bf43e92c51f26ae..c615e3fd693a252fd248206f4d2f39faf9665cb6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -10,9 +10,12 @@ 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()} - ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Reason set to ${response.reason} Not Found + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 9926142b0d725202bbcf60132b2b29362a27dc8a..7269685b66d7d85f9ddbec7db51e1a5ae07fd457 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 *** @@ -24,12 +24,15 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ... ${subscription_id} ... ${subscription_update_fragment} Check Response Status Code 204 ${response.status_code} + Check Response Does Not Contain Body ${response} + Check Response Reason set to ${response.reason} No Content + ${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_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 63bcdd789df1437004441d53fa758fe421d0e29c..bee88a1d9376eaf102cef9169af6666f5487c423 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -17,7 +17,6 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${response}= Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index c1688c1947abb563c3febe3b29fa6aca9e4076c8..b76d710e65bc8ed776495d39787a8214b4a76aca 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -19,7 +19,6 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ... urn:ngsi-ld:Subscription:unknowSubscription ... ${subscription_update_fragment} Check Response Status Code 404 ${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()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 61bd43c1606cbbf0c9d02a2a1ae6cb5198891595..b9b6c64092ddf90a761713ada321d4f7ab7970c6 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 @@ -32,10 +33,9 @@ Update Context Source Registration Subscription With Invalid Fragment ... ${subscription_id} ... ${subscription_update_fragment} Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index f80af4b8ce6a2a096d2265a854d19097ad668fad..a843710992964183e8bace7204a6fa1dd745a175 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 *** @@ -23,10 +23,9 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ... ${subscription_id} ... ${subscription_update_fragment_file_path} Check Response Status Code 400 ${response.status_code} - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_INVALID_REQUEST} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Body Containing ProblemDetails Element + ... response_body=${response.json()} + ... problem_type=${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** diff --git a/data/csourceRegistrations/context-source-registration-csourceProperty-sample.jsonld b/data/csourceRegistrations/context-source-registration-csourceProperty-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..a76f1967cbf3761df68ad1fa0f1eeda5ed7663aa --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-csourceProperty-sample.jsonld @@ -0,0 +1,23 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"Point", + "coordinates":[-8.521,41.2] + }, + "endpoint":"http://my.csource.org:1026", + "csourceProperty1": "aValue", + "csourceProperty2": "anotherValue", + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-json-sample.json b/data/csourceRegistrations/context-source-registration-invalid-json-sample.json new file mode 100644 index 0000000000000000000000000000000000000000..e72bb9a4e4d86ccae072733c37f46f7e201062c6 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-invalid-json-sample.json @@ -0,0 +1,5 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration",, + "endpoint": "http://my.new.csource.org:1026" +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-sample.json b/data/csourceRegistrations/context-source-registration-invalid-sample.json new file mode 100644 index 0000000000000000000000000000000000000000..b097e4f53a1dbe28e449f2f84065ee7436d2a22b --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-invalid-sample.json @@ -0,0 +1,5 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": null +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld index 06fe7cc9e7e0c620250ac8ee94a5d343ae3329c0..595a5d63d58ee07981092230f9cb4e44cf5e37c0 100644 --- a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld @@ -1,39 +1,7 @@ { - "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID",, + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", "type": "ContextSourceRegistration", - "information": [ - { - "entities": [ - { - "id": "urn:ngsi-ld:Vehicle:A456", - "type": "Vehicle" - } - ], - "propertyNames": ["brandName","speed"], - "relationshipNames": ["isParked"] - }, - { - "entities": [ - { - "idPattern": ".*downtown$", - "type": "OffStreetParking" - }, - { - "idPattern": ".*47$", - "type": "OffStreetParking" - } - ], - "propertyNames": ["availableSpotNumber","totalSpotNumber"], - "relationshipNames": ["isNextToBuilding"] - } - ], - "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - }, + "information": null, "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld index c119434b217a4d043a576358432a59133b004ebb..a5603e7b82571b456458a8021ee882fe343a281b 100644 --- a/data/csourceRegistrations/context-source-registration-location-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -11,11 +11,8 @@ } ], "location":{ - "type":"GeoProperty", - "value":{ - "type":"Point", - "coordinates":[-8.521,41.2] - } + "type":"Point", + "coordinates":[-8.521,41.2] }, "endpoint":"http://my.csource.org:1026", "@context":[ diff --git a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json index f96e148a8cfc62b0fa453f50bc9dc895d046dace..c557935b32c73e5c7250b206b7aed5056684cedd 100644 --- a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json +++ b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json @@ -1,14 +1,68 @@ { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"https://ngsi-ld-test-suite/context#Building" - } - ] - } - ], - "endpoint":"http://my.csource.org:1026" -} \ No newline at end of file + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "endpoint": "http://my.csource.org:1026", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "https://ngsi-ld-test-suite/context#Vehicle" + } + ], + "propertyNames": [ + "https://ngsi-ld-test-suite/context#brandName", + "https://ngsi-ld-test-suite/context#speed" + ], + "relationshipNames": [ + "isParked" + ] + }, + { + "entities": [ + { + "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "idPattern": ".*downtown$" + }, + { + "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "idPattern": ".*47$" + } + ], + "propertyNames": [ + "availableSpotNumber", + "totalSpotNumber" + ], + "relationshipNames": [ + "isNextToBuilding" + ] + } + ], + "location": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ] + } +} diff --git a/data/csourceRegistrations/expectations/context-source-registration.json b/data/csourceRegistrations/expectations/context-source-registration.json index b4a6b06efb3f5a7e307eb5f2467e5b92afb248ac..a534ebc79efd2b876087d1a57917b21c67e5078d 100644 --- a/data/csourceRegistrations/expectations/context-source-registration.json +++ b/data/csourceRegistrations/expectations/context-source-registration.json @@ -1,14 +1,37 @@ { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } ], - "endpoint":"http://my.csource.org:1026" + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + } } \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json index 0ddd335ca69f8484aa28852e8b385235cb7b08d3..60ca6aadf70178bc7f1a192435d7fbee2088a0f1 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 @@ -1,16 +1,70 @@ [ - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "endpoint":"http://my.csource.org:1026" - } + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": [ + "brandName", + "speed" + ], + "relationshipNames": [ + "isParked" + ] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": [ + "availableSpotNumber", + "totalSpotNumber" + ], + "relationshipNames": [ + "isNextToBuilding" + ] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ] + } + } ] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json index 0ddd335ca69f8484aa28852e8b385235cb7b08d3..26d12558396afde17e83cc46fc5eae3d20d51632 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json @@ -1,16 +1,39 @@ [ - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ { - "entities":[ - { - "type":"Building" - } - ] + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] } - ], - "endpoint":"http://my.csource.org:1026" - } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + } + } ] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json index 25b886f0bd2af3453720ca84284313b26077d47f..3240674ad45240d610e5eb312e4d681a7b2b9678 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json @@ -1,37 +1,42 @@ [ - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "endpoint":"http://my.csource.org:1026" - }, - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "location":{ - "type":"GeoProperty", - "value":{ - "type":"Point", - "coordinates":[-8.521,41.2] - } - }, - "endpoint":"http://my.csource.org:1026" - } + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ] + } + ], + "endpoint": "http://my.csource.org:1026" + }, + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ] + } + ], + "location": { + "type": "Point", + "coordinates": [ + -8.521, + 41.2 + ] + }, + "endpoint": "http://my.csource.org:1026", + "csourceProperty1": "aValue", + "csourceProperty2": "anotherValue", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] + } ] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json index c462e3a6fc0150248ae10cc2b23efb34a879a6f3..28836a2ebbce818b83bf2d96a5ac02a4d4b69c77 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json @@ -1,23 +1,28 @@ [ - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "location":{ - "type":"GeoProperty", - "value":{ - "type":"Point", - "coordinates":[-8.521,41.2] - } - }, - "endpoint":"http://my.csource.org:1026" - } + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ] + } + ], + "location": { + "type": "Point", + "coordinates": [ + -8.521, + 41.2 + ] + }, + "endpoint": "http://my.csource.org:1026", + "csourceProperty1": "aValue", + "csourceProperty2": "anotherValue", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] + } ] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json index 0d7f5b3cc1d28e9b8238c2677090ff4e9c54d2e8..74af173bc058800d637e0c04322652de91d31a17 100644 --- a/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json @@ -1,58 +1,63 @@ [ - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "endpoint":"http://my.csource.org:1026" - }, - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ], - "propertyNames":[ - "name", - "subCategory" - ], - "relationshipNames":[ - "locatedAt" - ] - } - ], - "endpoint":"http://my.csource.org:1026" - }, - { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } - ], - "location":{ - "type":"GeoProperty", - "value":{ - "type":"Point", - "coordinates":[-8.521,41.2] - } - }, - "endpoint":"http://my.csource.org:1026" - } + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ] + } + ], + "endpoint": "http://my.csource.org:1026" + }, + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ], + "propertyNames": [ + "name", + "subCategory" + ], + "relationshipNames": [ + "locatedAt" + ] + } + ], + "endpoint": "http://my.csource.org:1026" + }, + { + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Building" + } + ] + } + ], + "location": { + "type": "Point", + "coordinates": [ + -8.521, + 41.2 + ] + }, + "endpoint": "http://my.csource.org:1026", + "csourceProperty1": "aValue", + "csourceProperty2": "anotherValue", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] + } ] \ No newline at end of file diff --git a/data/csourceRegistrations/fragments/context-source-registration-null-expiresAt.json b/data/csourceRegistrations/fragments/context-source-registration-null-expiresAt.json new file mode 100644 index 0000000000000000000000000000000000000000..3d463007a5c689c02dd66a3915bf38a53968b5cf --- /dev/null +++ b/data/csourceRegistrations/fragments/context-source-registration-null-expiresAt.json @@ -0,0 +1,3 @@ +{ + "expiresAt": null +} \ No newline at end of file diff --git a/data/entities/building-simple-attributes-second-sample.jsonld b/data/entities/building-simple-attributes-second-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..a79af10ebaaebb4a46e91aec914ac85f6b6e901f --- /dev/null +++ b/data/entities/building-simple-attributes-second-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Pisa Tower" + }, + "subCategory": { + "type": "Property", + "value": "tourism" + }, + "airQualityLevel": { + "type": "Property", + "value": 6, + "unitCode": "C62", + "observedAt": "2020-10-10T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": true + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} diff --git a/data/entities/expectations/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/data/subscriptions/subscription-building-entities-active-notificationAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-notificationAttributes.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..e03e0dbd81100701e0a81e2d76cf9449c244a5cf --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-notificationAttributes.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + }, + "attributes": ["airQualityLevel"] + }, + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-invalid-negative-throttling-sample.jsonld b/data/subscriptions/subscription-invalid-negative-throttling-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..19201f3a967f6e3e970c0954ecd6a79e8f77079c --- /dev/null +++ b/data/subscriptions/subscription-invalid-negative-throttling-sample.jsonld @@ -0,0 +1,17 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "throttling" : -30 +} \ No newline at end of file diff --git a/data/subscriptions/subscription-invalid-throttling-timeInterval-sample.jsonld b/data/subscriptions/subscription-invalid-throttling-timeInterval-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..f3e348663f48a199947bc3c1075530300741d915 --- /dev/null +++ b/data/subscriptions/subscription-invalid-throttling-timeInterval-sample.jsonld @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "timeInterval": 10, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "throttling" : 30 +} \ No newline at end of file diff --git a/data/subscriptions/subscription-valid-throttling-sample.jsonld b/data/subscriptions/subscription-valid-throttling-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..94b95eaee6344d22c810c6dcdfb0b1fe21845756 --- /dev/null +++ b/data/subscriptions/subscription-valid-throttling-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "throttling" : 15, + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld index 605f67d9d2a65e09e49022307b4e07814c5e2e0e..8efc2ba33f79ad4267f0e901c3081f8b5348e1e2 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld @@ -1,16 +1,14 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "fuelLevel":[{ + "fuelLevel":{ "type":"Property", "value":67, "observedAt":"2020-08-01T12:03:00Z" - }], - "speed":[ - { + }, + "speed":{ "type":"Property", "value":120, "observedAt":"2020-08-01T12:03:00Z" - } - ] + } } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld index c0390362f3193a00b0c5bad6c3dc2a24835cd368..e5bb683ddeb6bb14df860a402368a8581682101a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld @@ -1,11 +1,11 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "fuelLevel":[{ + "fuelLevel":{ "type":"Property", "value":67, "observedAt":"2020-08-01T12:03:00Z" - }], + }, "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld index 6b84b98c1180e563eb16660da830bacc6ae66a59..77db2073b912a5328850a5865f648f8fe33ae396 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld @@ -13,14 +13,12 @@ "observedAt":"2020-09-01T12:05:00Z" } ], - "fuelLevel":[ - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z", - "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" - } - ], + "fuelLevel":{ + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + }, "@context":[ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld index 3bfbec07ff72d31685cfd8f43c011f42d4c91c5f..9c31bb90f3a947dfc6438f02a9dc4141e70a8599 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld @@ -1,13 +1,11 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "speed":[ - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - } - ], + "speed":{ + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-01-expectation.json b/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-01-expectation.json new file mode 100644 index 0000000000000000000000000000000000000000..229b21fe33ee524424a9c8f51ebef15289cf6ba5 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-01-expectation.json @@ -0,0 +1,70 @@ +[ + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "values": [ + [ + 80.0, + "2020-08-01T12:05:00Z" + ], + [ + 100.0, + "2020-08-01T12:07:00Z" + ] + ] + }, + "fuelLevel": { + "type": "Property", + "values": [ + [ + 53.0, + "2020-08-01T13:05:00Z" + ], + [ + 40.0, + "2020-08-01T14:07:00Z" + ] + ] + } + }, + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-09-01T12:03:00Z" + ], + [ + 80.0, + "2020-09-01T12:05:00Z" + ], + [ + 100.0, + "2020-09-01T12:07:00Z" + ] + ] + }, + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-09-01T12:03:00Z" + ], + [ + 53.0, + "2020-09-01T13:05:00Z" + ], + [ + 40.0, + "2020-09-01T14:07:00Z" + ] + ] + } + } +] diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-02-expectation.json b/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-02-expectation.json new file mode 100644 index 0000000000000000000000000000000000000000..6b0c8547ba2f22ebd7147fb323a5b1bf60af4385 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-14-02-expectation.json @@ -0,0 +1,74 @@ +[ + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-08-01T12:03:00Z" + ], + [ + 80.0, + "2020-08-01T12:05:00Z" + ], + [ + 100.0, + "2020-08-01T12:07:00Z" + ] + ] + }, + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-08-01T12:03:00Z" + ], + [ + 53.0, + "2020-08-01T13:05:00Z" + ], + [ + 40.0, + "2020-08-01T14:07:00Z" + ] + ] + } + }, + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-09-01T12:03:00Z" + ], + [ + 80.0, + "2020-09-01T12:05:00Z" + ], + [ + 100.0, + "2020-09-01T12:07:00Z" + ] + ] + }, + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-09-01T12:03:00Z" + ], + [ + 53.0, + "2020-09-01T13:05:00Z" + ] + ] + } + } +] \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld index f9261a4598009ad85546502ec40763a9db3601af..632a63a549706bcc0f1a0fa5985fd781c0dfe19c 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld @@ -1,7 +1,5 @@ -[ - { - "type":"Property", - "value":129, - "observedAt":"2020-09-01T12:03:00Z" - } -] \ No newline at end of file +{ + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" +} 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..3c068c1345e9aecd593edec8ca12411dc3b9c647 --- /dev/null +++ b/doc/analysis/checks.py @@ -0,0 +1,1057 @@ +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 a Boolean Attribute set to': + Checks.check_response_body_containing_a_boolean_attribute_set_to, + 'Check Response Body Contains DateTime Value': + Checks.check_response_body_contains_datetime_value, + 'Check Response Body Containing ProblemDetails Element Containing Title Element': + Checks.check_response_body_containing_problemdetails_element_containing_title_element, + 'Check Dictionary Might Contain Additional Members of the NotificationParams': + Checks.check_dictionary_might_contain_additional_members, + 'Check Response Body Containing ProblemDetails Element': + Checks.check_response_body_containing_problemdetails_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, + 'Check JSON Value Not In Response Body': + Checks.check_json_value_not_in_response_body, + 'Check Response Reason set to': + Checks.check_response_reason_set_to, + 'Check Response Does Not Contain Body': + Checks.check_response_does_not_contain_body, + 'Check Response Header is Empty': + Checks.check_response_header_is_empty, + 'Check Response Headers Link set to': + Checks.check_response_headers_link_set_to, + 'Check Response Headers Containing NGSILD-Results-Count Equals To' : + Checks.check_response_header_contains_ngsild_results_count_equals_to, + } + + 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 Body Containing ProblemDetails Element': { + 'params': ['problem_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 Dictionary Might Contain Additional Members of the NotificationParams': { + 'params': ['dictionary', 'key'], + 'position': [0, 1] + }, + '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 a Boolean Attribute set to': { + 'params': ['expected_attribute_name', 'response_body', 'expected_attribute_value'], + 'position': [0, 1, 2] + }, + 'Check Response Body Contains DateTime Value': { + 'params': ['dictionary', 'key', 'expected value'], + 'position': [0, 1, 2] + }, + '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] + }, + 'Check JSON Value Not In Response Body': { + 'params': ['json_path_expr'], + 'position': [0] + }, + 'Check Response Reason set to': { + 'params': ['reason'], + 'position': [1] + }, + 'Check Response Does Not Contain Body': { + 'params': ['response'], + 'position': [0] + }, + 'Check Response Header is Empty': { + 'params': ['response_headers'], + 'position': [0] + }, + 'Check Response Headers Link set to': { + 'params': ['response_headers', 'expected_link_header'], + 'position': [0, 1] + } + , + 'Check Response Headers Containing NGSILD-Results-Count Equals To': { + 'params': ['expected_result_count' , 'response_headers'], + 'position': [0, 1] + } + } + + @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 check_response_header_is_empty(kwargs: list) -> str: + return "The response header contains an empty dictionary" + + @staticmethod + def check_response_headers_link_set_to(kwargs: list) -> str: + return f"The response headers Link is set to '{kwargs['expected_link_header']}'" + + @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_reason_set_to(kwargs: list) -> str: + return f"Response reason set to '{kwargs['reason']}'" + + @staticmethod + def check_response_does_not_contain_body(kwargs: list) -> str: + return f"Response does not contain a body" + + @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_body_containing_a_boolean_attribute_set_to(kwargs: list) -> str: + return (f"Check that the payload body contains a boolean attribute with name " + f"'{kwargs['expected_attribute_name']}' and value '{kwargs['expected_attribute_value']}") + + @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_dictionary_might_contain_additional_members(kwargs: list) -> str: + if 'dictionary' in kwargs and 'key' in kwargs: + return f"The dictionary `{kwargs['dictionary']}' might contain the key '{kwargs['key']}'" + else: + raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") + + @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_contains_datetime_value(kwargs: list) -> str: + # ${dictionary} ${key} ${expected value} + return (f"Check that the dictionary contains the key '{kwargs['key']}' with type DateTime and value set " + f"to '{kwargs['expected value']}'") + + @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_containing_problemdetails_element(kwargs: list) -> str: + if 'problem_type' in kwargs: + problem_type = kwargs['problem_type'] + return (f"Response Body containing the type '{problem_type}' and " + f"Response Body Title is a string and is not ${{EMPTY}} and " + f"Response Body Detail is a string and is not ${{EMPTY}} and " + f"Response Boty Title is not equal to Response Body Detail") + 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_json_value_not_in_response_body(kwargs: list) -> str: + if 'json_path_expr' in kwargs: + key = kwargs['json_path_expr'] + return f"Check that response body does not contain the key '{key}'" + 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}' list of keys" + # 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}'") + + @staticmethod + def check_response_header_contains_ngsild_results_count_equals_to(kwargs: list) -> str: + if 'expected_result_count' in kwargs: + expected_result_count = kwargs['expected_result_count'] + return f'Response Header: NGSILD-Results-Count equals to {expected_result_count}' + else: + raise Exception(f"ERROR, Expected 'expected_result_count' 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() + print(data.get_checks(checks='Check Response Headers Containing NGSILD-Results-Count Equals To')) + + # 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..ba74bcb037b6e5679eb5b5fca9139c8b5279a8ed --- /dev/null +++ b/doc/analysis/generaterobotdata.py @@ -0,0 +1,572 @@ +from os.path import dirname +from robot.api import TestSuiteBuilder +from doc.analysis.parserobotfile import ParseRobotFile +from doc.analysis.parseapiutilsfile import ParseApiUtilsFile +from doc.analysis.parsevariablesfile import ParseVariablesFile +from doc.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) + 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 []' + } + 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.') + + @staticmethod + def get_permutation_keys(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 = list() + + # 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 = r'(\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) + + verb = str() + query_param = str() + url = str() + 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: + aux = list() + # 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 not query_param: + 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, clauses = self.generate_reference(version=version) + + # TODO: robotframework==7.0 has not property keywords in the class TestSuite(), we can get the data from + # [x.to_dict()['name'] for x in list(self.suite.resource.keywords)] but with some differences in execution code + self.test_suite = { + 'tp_id': tp_id, + 'test_objective': self.suite.doc, + 'reference': reference, + 'config_id': str(), + 'parent_release': version, + 'clauses': clauses, + 'pics_selection': str(), + # 'keywords': [str(x) for x in self.suite.keywords], + 'keywords': [x.to_dict()['name'] for x in list(self.suite.resource.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, clauses = self.generate_reference_template(version=version) + else: + if len(self.robot.test_template_name) == 0: + # We have normal tests cases + reference, clauses = 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, clauses = self.generate_reference_testcases(tags=tags, version=version) + _, _ = self.generate_reference_template(version=version, need_tags=False) + + return reference, clauses + + 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, clauses = self.get_info_from_template(name=template_name, + string=string, + version=version, + need_tags=need_tags) + + return reference, clauses + + 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() + clauses = list() + + tags = self.get_substring(string=string, key='[Tags]') + self.tags_template = tags[1:] + + if need_tags: + try: + clauses = list(set([element.replace("_", ".") + for sublist in tags for element in tags if element[0].isdigit()])) + clauses.sort() + except IndexError: + raise Exception("ERROR, Probably [Tags] does not include reference to the section in the spec.") + + if len(clauses) == 1: + reference = f'{self.references[version]}, clause {clauses[0]}' + elif len(clauses) > 1: + reference = f'{self.references[version]}, clauses {", ".join(clauses)}' + + # clauses = 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, clauses + + @staticmethod + def get_substring(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): + clauses = [x.replace("_", ".") for x in tags if match(pattern=r'^(\d+_\d+_\d+)|^(\d+_\d+)', string=x)] + clauses = list(set(clauses)) + clauses.sort() + + if len(clauses) == 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') + elif len(clauses) == 1: + reference = f'{self.references[version]}, clause {clauses[0]}' + else: + reference = f'{self.references[version]}, clauses {", ".join(clauses)}' + + return reference, clauses diff --git a/doc/analysis/initial_setup.py b/doc/analysis/initial_setup.py new file mode 100644 index 0000000000000000000000000000000000000000..a23d90777071579155381b304e8d708e01f16c2c --- /dev/null +++ b/doc/analysis/initial_setup.py @@ -0,0 +1,289 @@ +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(f" 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(f" 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: + if initial_condition is not None: + data = self.init[initial_condition] + else: + data = '''with { + the SUT containing an initial state +}''' + 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..d1caf3823b6905ec2922e13c470bf351a287c2cc --- /dev/null +++ b/doc/analysis/parseapiutilsfile.py @@ -0,0 +1,141 @@ +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') + + for i, item in enumerate(string): + if 'response' in item: + regex = r"\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, bool]: + # 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 = r"^(\$\{.*\})\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 = r'(\&\{.*\})' + 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 = r'\.{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..2d9666b5d565c654a830ba312257a8dd0538cb3b --- /dev/null +++ b/doc/analysis/parserobotfile.py @@ -0,0 +1,524 @@ +import re +import os +from doc.analysis.checks import Checks +from doc.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..a7cbb1a61fdfafb1692c47db681218d8530ac52f --- /dev/null +++ b/doc/analysis/parsevariablesfile.py @@ -0,0 +1,31 @@ +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() + + # Generate a list of lines from the file content + file_content = file_content.split('\n') + + # Dismiss the blank lines and the lines starting with # -> comments + file_content = [x for x in file_content if x != '' and x[0] != '#'] + + # Extract the key = value format of the variables + file_content = [x.split('=') for x in file_content if x != ''] + + # Delete the ' characters from the keys and delete blank spaces + 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..612d9a58e1a30c380b87bd3054a680934db8afe5 --- /dev/null +++ b/doc/analysis/requests.py @@ -0,0 +1,1570 @@ +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', 'options'] + }, + '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', 'count', 'q'] + }, + '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', 'idPattern', 'attrs', + 'q', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timeproperty', 'timerel', + 'timeAt', 'limit', 'offset', '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 From File': { + 'positions': [0, 1], + 'params': ['context_source_registration_id', 'filename'] + }, + '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, + 'Update Context Source Registration From File': + Requests.update_context_source_registration_from_file, + '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', 'options'] + + 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}'" + case 'options': + response = f"{response} and\n Query Parameter: options 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', 'count' , 'q'] + + 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 'count': + response = f"{response} and\n Query Parameter: count set to '{value}'" + case 'q': + response = f"{response} and\n Query Parameter: q 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_from_file(kwargs) -> str: + if 'context_source_registration_id' in kwargs and 'filename' in kwargs: + return (f"Update Context Source Registration " + f"with CSR Id set to '{kwargs['context_source_registration_id']}' and " + f"subscription update from file '{kwargs['filename']}'") + 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', 'idPattern', 'attrs', + 'q', 'csf', 'georel', 'geometry', + 'coordinates', 'geoproperty', 'timeproperty', 'timerel', + 'timeAt', 'limit', 'offset', 'accept'] + + # kwargs = {key: kwargs.get(key, '${EMPTY}') for key in expected_parameters} + + 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 'idPattern': + response = f"{response} and\n Query Parameter: idPattern 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 '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 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..a2c342ab577e9a36726ed93d8889685216590c51 --- /dev/null +++ b/doc/files/CommonBehaviours/043_01.json @@ -0,0 +1,108 @@ +{ + "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", + "clauses": [ + "5.2.2" + ], + "pics_selection": "", + "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", + "cb-ldcontext", + "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", + "cb-ldcontext", + "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", + "cb-ldcontext", + "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", + "cb-ldcontext" + ], + "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", + "cb-ldcontext", + "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": [ + "endpoint", + "then", + "when" + ], + "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..0452c10b00d28f82be3f1a24bf20d48e5bcdf3e6 --- /dev/null +++ b/doc/files/CommonBehaviours/044_01.json @@ -0,0 +1,39 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "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", + "cb-mergepatch", + "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..80ee40408aba5563f8709351fa56eddaa2acb0e4 --- /dev/null +++ b/doc/files/CommonBehaviours/044_02.json @@ -0,0 +1,39 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Subscription", + "Delete Initial Subscription" + ], + "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", + "cb-mergepatch", + "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..f0c2261e4002b7d80715a3238a29e55894643b91 --- /dev/null +++ b/doc/files/CommonBehaviours/045_01.json @@ -0,0 +1,91 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "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", + "cb-get", + "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", + "cb-get", + "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", + "cb-get", + "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", + "cb-get", + "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": [ + "endpoint", + "then", + "when" + ], + "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..5721211f0383b520151aa25fea70fc6b5820287c --- /dev/null +++ b/doc/files/CommonBehaviours/048_01.json @@ -0,0 +1,126 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "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", + "cb-unsupport-medtype", + "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", + "cb-unsupport-medtype", + "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", + "cb-unsupport-medtype", + "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", + "cb-unsupport-medtype", + "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", + "cb-unsupport-medtype" + ], + "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", + "cb-unsupport-medtype", + "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": [ + "endpoint", + "http_verb", + "then", + "when" + ], + "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..cc2f9a93fb8bd3cbff0346151ce73eec868a031e --- /dev/null +++ b/doc/files/CommonBehaviours/049_01.json @@ -0,0 +1,108 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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": [ + "endpoint", + "then", + "when" + ], + "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..020f97efbd10a85d1e54e1bd727822adf956991a --- /dev/null +++ b/doc/files/CommonBehaviours/049_02.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "6.3.4" + ], + "pics_selection": "", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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", + "cb-noacceptable-medtype", + "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": [ + "endpoint", + "then", + "when" + ], + "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..d25620acf75c70f54a4313a17880049c13638746 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "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..4aff9ddf1142097b4dd42efa058f222b30b2e62d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "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..2e7bef604b41c6931524ba1004d0641aed875ead --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_01_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "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..0edd12cc3eb476d64b61eb4fd8bfa30b099e3403 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "keywords": [ + "Get Entity With Invalid Id" + ], + "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..7d2e069b5243c88b67f4fc018fa25b469a2c5122 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_03_01.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "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..0e4d74a375bcb17fb9e449accced94997c8dedf5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_03_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.1" + ], + "pics_selection": "", + "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..ed3011358f20ec6f5c2054949c3462c4425c59f0 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_04.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "6.3.7" + ], + "pics_selection": "", + "keywords": [ + "Delete Created Entity" + ], + "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..237b6beb0c4e65ba2d6bfe8d548e537d11acc2d7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_05.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "6.3.7" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity In GeoJSON Representation", + "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..a17ae1c3b896ee5c23728c70e27235a8f48cacef --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_06.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Review JSON-LD Resolution When retrieving an entity", + "Setup Initial Entity", + "Delete Created Entity" + ], + "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..28bb8ddae445e4c8be5bef5d461ce7c17a94e1e2 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..c83004741877a906a73e09de909226b1dc03f0c0 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..cff4ac0a5f2b4e5988f1398e19204f95ab563819 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..d748fa8b0f73b16fb7326d950d9bd2072f800045 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_04.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..d7c2dcd4b75f35777c72760ba56125eec4859175 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_01_05.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..1471f5f433cbc8d7d78d5a0a8e802bac8e685b89 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..cfcf88af795cadb06dd15bcb0d845e4077fe69b9 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..2860bf8d8fe43c5e5ed925b60f36a23f859ed22a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..de2976e2f31ec3546e325d36f736761f59a69e89 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..db75a2738bdf9f25b1bd516c9171912595ba7ffd --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..50cb5365a151f955099e4517c49820caded49e01 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..17b5464c9a25efc939c5205609e74ccd01e13d90 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..3dfa22fe513abb7cf9c70749ee68285aa449d2b2 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..0d3ed4405f80c7ccce0792685812e4320994ca39 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_04.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..477b5a8dfbe300fdcc7f766be5eac0172a26728f --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_03_05.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "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..78ed17f1cd9496608b483b549221647b763e0308 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_04.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "6.3.7" + ], + "pics_selection": "", + "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..3a8d9be2cf3a8b73d8934350b417d3cbb0e4c549 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "6.3.7" + ], + "pics_selection": "", + "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..5d70cf016cfd23135869e916fb83211d49c68772 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_06.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "6.3.10" + ], + "pics_selection": "", + "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/019_07.json b/doc/files/ContextInformation/Consumption/019_07.json new file mode 100644 index 0000000000000000000000000000000000000000..8b688e4978303c9515bdd828f850e1c60be9922d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_07.json @@ -0,0 +1,60 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_07", + "test_objective": "If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 5.7.2, 6.3.13", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.7.2", + "6.3.13" + ], + "pics_selection": "", + "keywords": [ + "Query Entities With Count", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_07_01 Check that the total number of matching results is returned if the count parameter is set to true and only the entity type is provided", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_07_01", + "doc": "If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.", + "tags": [ + "e-query", + "5_7_2", + "6_3_13" + ], + "setup": null, + "teardown": null, + "template": "Query Entities With Count", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to ${expected_status_code} and\n Query Entities with Response Header: NGSILD-Results-Count equals to 2\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 'Building' and\n Query Parameter: q set to '${q}' and\n Query Parameter: count set to '${True}' 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/" + }, + { + "name": "019_07_02 Check that the total number of matching results is returned if the count parameter is set to true and a q parameter is provided", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_07_02", + "doc": "If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.", + "tags": [ + "e-query", + "5_7_2", + "6_3_13" + ], + "setup": null, + "teardown": null, + "template": "Query Entities With Count", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to ${expected_status_code} and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\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 'Building' and\n Query Parameter: q set to '${q}' and\n Query Parameter: count set to '${True}' 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": [ + "then" + ], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_07" +} \ 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..0e8cc7c667301dc6537e026ce70e46241776dc8b --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..ed48c4f77c1062818b5685226dd6be0c705cb2e7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..55afadde9d8442ccdc7cd57b35207b82facc4b7d --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "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..2a74af7de6cd1afa907a2ec339383ab6fe46902e --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_04.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "keywords": [ + "Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query", + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "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..b47b46515ffa48e0b8417c11e9a2eaf3c4543cc6 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_05.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "keywords": [ + "Retrieve the temporal evolution of the last N instances of entity attributes", + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "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..cd4ca044833c6cf8a954ce13a904bc2e1dd98e5b --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_06.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..c503e41a1e05a328345199832509ed787f4c0a48 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_07.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..058a359b7271d4a346056b04fd46531bb2f19b69 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_08.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..2b0f0feb9547639c81d4cce93b55e059d7b108b9 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_09.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "keywords": [ + "Retrieve the temporal evolution of an entity with an invalid request content", + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "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..151f1dd524f320f4f8f872e250bf6777d1f24e1b --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_10.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.3" + ], + "pics_selection": "", + "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..ccf6e75f110e864b8927dab2b640973ee21da6c0 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_01.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Query the temporal evolution of entities", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..f06d4efca8114d1a62bc95c57ac85898e6cad90e --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..21060d4e6e19763a214b2490be9e38d652e84ea3 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..7b34c6861d247c4e0b18a29ba2eb35f180e159f7 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..761143a1a1c1087e7b0af64dd6da6d8e66297174 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..287ef1d22c5be69cdb2fb0e71527bf6da0c0bf70 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_06.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..e7e51ca7678f804bfba9055a885cba8c961d64b1 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_07.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..8d9727be9801667b495367759f5aa16c0bcb9f0a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_08.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..914b647546c4cad43fee418ab28918622be9ef57 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_09.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Query the temporal evolution of entities matching the given NGSI-LD geo-query", + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "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..17082eaaafbc6bb8de9b5976bbadbefb6c3ccd5e --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_10.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Context Source Registration and Mock Server", + "Delete Initial Context Source Registration and Mock Server" + ], + "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..52059da0afda9969691f244a20645b085bee98db --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_11.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Query the temporal evolution of entities with a limit to the number of entities to be retrieved", + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "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..3ecf629183d6d185325f40b58ed05596efaae9cb --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_12.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "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..ec2c4f635fa3dc5a6ee0cf16792bcb456822bb12 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_13.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Query the temporal evolution of entities using the entityOperations method", + "Setup Initial Temporal Entities", + "Delete Initial Temporal Entities" + ], + "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/021_14.json b/doc/files/ContextInformation/Consumption/021_14.json new file mode 100644 index 0000000000000000000000000000000000000000..2257cdf07a2cf544f7797cda6a0b7b331cdd0400 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_14.json @@ -0,0 +1,58 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_14", + "test_objective": "Check that you can query the temporal evolution of entities with the simplified representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.7.4" + ], + "pics_selection": "", + "keywords": [ + "Query the temporal evolution of entities", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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_14_01 After", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_14_01", + "doc": "Check that you can query the temporal evolution of entities with the simplified representation", + "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-14-01-expectation.json'\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' and\n Query Parameter: options set to 'temporalValues'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_14_02 Before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_14_02", + "doc": "Check that you can query the temporal evolution of entities with the simplified representation", + "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-14-02-expectation.json'\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' and\n Query Parameter: options set to 'temporalValues'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_14" +} \ 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..c81516bc0342921bb8ad347cdad05279e33fcd49 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/022_01.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.5" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Available Entity Types", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..9304f516396f2f1f17314461219d29fe9c0390a5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/023_01.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.6" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Details Of Available Entity Types", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..32abe0f1d71c200c2302ffcde7a55044c1fd2b25 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/024_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.7" + ], + "pics_selection": "", + "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..b3e7e9ef20b1027134d27845abb227d4cab728bc --- /dev/null +++ b/doc/files/ContextInformation/Consumption/024_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.7" + ], + "pics_selection": "", + "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..d7d1260bdcf8e19bf6abc396452160b439b7f2ac --- /dev/null +++ b/doc/files/ContextInformation/Consumption/025_01.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.8" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Available Attributes", + "Setup Initial Entity", + "Delete Initial Entity" + ], + "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..e00b43dc7e0e5d1404f774732245207ea4d39b1f --- /dev/null +++ b/doc/files/ContextInformation/Consumption/026_01.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.7.9" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Details Of Available Attributes", + "Setup Initial Entity", + "Delete Initial Entity" + ], + "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..421007f9e3bfa03ce91c92e394ccc961c94b066a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/027_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.10" + ], + "pics_selection": "", + "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..d378877557bf6d5365ebf465a9a7b1c13da1f31a --- /dev/null +++ b/doc/files/ContextInformation/Consumption/027_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.7.10" + ], + "pics_selection": "", + "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..0bfc084d940a768c324f95448ddda0bf980e1e8f --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_01.json @@ -0,0 +1,88 @@ +{ + "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", + "clauses": [ + "5.6.1" + ], + "pics_selection": "", + "keywords": [ + "Create Entity Scenarios", + "Delete Initial Entity" + ], + "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}' list of keys\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}' list of keys\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}' list of keys\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}' list of keys\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..81a53fb3cec4f1f3f508841186dfdcc24945a573 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_02.json @@ -0,0 +1,72 @@ +{ + "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", + "clauses": [ + "5.6.1" + ], + "pics_selection": "", + "keywords": [ + "Create Entity With Invalid Request Scenarios" + ], + "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..406bd644a0c97459006d1dfc8a1510a6b66f102a --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.1" + ], + "pics_selection": "", + "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..c52a5a09848383027c4e6c103ef7b9e9bfffd1cb --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_04.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entity" + ], + "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..d62f0e51fa927a8b5748745986b6c75167b17a80 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_05.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entity" + ], + "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..b9b9822c4679fd840c33d395bfd99310797ed139 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_06.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..5d99bef0b35aa40f61309f15b4514071e7889afe --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_07.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entity" + ], + "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..73b24d2df7bc9f92c5fd05f8f66f2dc8cc1232b7 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_08.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..4870ec22537c320dd05036847f459dfcdb8bf93c --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_09.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..ea1a0ae8f2b445d7efeaa78f1d0118378a0e6465 --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_01.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.6.6" + ], + "pics_selection": "", + "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..c563210c1e83e358f44b8384bcb94b0833e3cf0f --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_02.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.6" + ], + "pics_selection": "", + "keywords": [ + "Delete Entity Scenarios" + ], + "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..c56c145de2581bc48e8d06f8fcb771f15404dff0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/002_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.6.6" + ], + "pics_selection": "", + "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..1aa60d5cc664fbd2e9a874c97e9c35a9ca3f28dc --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_01.json @@ -0,0 +1,86 @@ +{ + "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", + "clauses": [ + "5.6.7" + ], + "pics_selection": "", + "keywords": [ + "Batch Create Entity Scenarios", + "Delete Initial Entities" + ], + "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..65f8c15bc290a6ef25dafa8f46c3b2cd78b967e4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.6.7" + ], + "pics_selection": "", + "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..8edd0961f865dbd28478edbc3314dfa8612ad0f1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_03.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.7" + ], + "pics_selection": "", + "keywords": [ + "Create Batch Entity With Invalid Request Scenarios" + ], + "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_02 EmptyJson", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/BE/003_03_02", + "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..dc73f06bc80cc82f54437ab38c7d71daf64f1a40 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_04.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entities" + ], + "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..0c1266991edf82d58d03a34f4c0d95e560cb967a --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_05.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entities" + ], + "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..8868b6a7c03b0c93e89e816feb41fa67b902f6e1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_06.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..436f5d68628c880dc7a77a8964073c93dbde9962 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_07.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entities" + ], + "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..9cc9abf3da0e72c184ac54bc7da775a75cbb9182 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_08.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..27667e06d1581a1a0b5a5b0ed776f010421b6b14 --- /dev/null +++ b/doc/files/ContextInformation/Provision/003_09.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..37c74bf50996538b2c3c6060c7ebe6b343b306b6 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_01.json @@ -0,0 +1,70 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Batch Upsert Entity Scenarios", + "Delete Initial Entities" + ], + "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..4d2eec8c4ae255e9d490c5cee2540c72662bded0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_02.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Batch Upsert Non-existing And Existing Entities Scenarios", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..6e024155fec71e18772886e15447fb795d00e15f --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_03.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Batch Upsert Existing Entities Scenarios", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..33f7bd0aba739fc006c22d9742d9f475729499e3 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_04.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Batch Upsert Entities With Update Option Scenarios", + "Setup Initial Entity", + "Delete Initial Entities" + ], + "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..551b379681a6fb72b13dad16e5738142b2897cc0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_05.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Delete Entities" + ], + "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..2e217abcd63c6087bd4146b691712e56dc2a1b03 --- /dev/null +++ b/doc/files/ContextInformation/Provision/004_06.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Batch Upsert Entity With Invalid Request Scenarios" + ], + "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": [ + "then", + "when" + ], + "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..946b236e07bd00aab249417cb670d432be3cf236 --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_01.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Batch Update Entity Scenarios", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..aef00418b007e2d54292bfa50d91d48eb866e8db --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_02.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Batch Update Entity With NoOverwrite Option Scenarios", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "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..6b73fdd05a782145d3be69304f0da29f72408963 --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.6.9" + ], + "pics_selection": "", + "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..38527c528392528e07af9ad9b42e1dccc4811eb7 --- /dev/null +++ b/doc/files/ContextInformation/Provision/005_04.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Batch Update Entity With Invalid Request Scenarios" + ], + "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": [ + "then", + "when" + ], + "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..81e54d432f87c4069071ecf46cf20ebb43075948 --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.10" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Entities" + ], + "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..ba73cc078dc6e4b06b2ad8c44f8bf352671949f1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.10" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Entity" + ], + "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..d7a8b45dd25bfa02beb02da1a5c0c3b1d9a06fff --- /dev/null +++ b/doc/files/ContextInformation/Provision/006_03.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.10" + ], + "pics_selection": "", + "keywords": [ + "Batch Delete Entity With Invalid Request Scenarios" + ], + "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": [ + "then", + "when" + ], + "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..188bc965d4bb010c90e67f6d47509479da5b0ea5 --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_01.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.11" + ], + "pics_selection": "", + "keywords": [ + "Create Temporal Entity", + "Delete Temporal Entity" + ], + "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}' list of keys\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}' list of keys\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..5bba381e84b98c4f49535fe17b7ddb3bfce0f3f4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_02.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.6.11" + ], + "pics_selection": "", + "keywords": [ + "Create Temporal Entity From File" + ], + "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..e1e4e21efb606cfb67c12962d4895f96be9d082c --- /dev/null +++ b/doc/files/ContextInformation/Provision/007_03.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.6.11" + ], + "pics_selection": "", + "keywords": [ + "Create Temporal Entity" + ], + "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..ca58c05cdbca6c335961a9af3ac551d55c763f1f --- /dev/null +++ b/doc/files/ContextInformation/Provision/008_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.11" + ], + "pics_selection": "", + "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..53e37b1ffacc41010420f6482b5d62bbe630be05 --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.16" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Temporal Entity" + ], + "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..3ac4a799a21c424a12270cdb4214b17fa7300280 --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_02.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.16" + ], + "pics_selection": "", + "keywords": [ + "Delete Temporal Entity" + ], + "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": [ + "then", + "when" + ], + "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..f1ba1f4adf4179b6ef650da7558d784d129f7aba --- /dev/null +++ b/doc/files/ContextInformation/Provision/009_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.6.16" + ], + "pics_selection": "", + "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..dea3aca0a5123649148c7ebf3eff2f0ceef1427b --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_01.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Append Attributes Without Params", + "Create Initial Entity", + "Delete Initial Entity" + ], + "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..14ecc1789146ebf886db1b56aba92fe376b7123f --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_02.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Append Attributes", + "Create Initial Entity", + "Delete Initial Entity" + ], + "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..b5ab8d9c581e4b0117df3ee673a9bbe838da78f0 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.3" + ], + "pics_selection": "", + "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..310e64c2df513f4db25483aa739678e952d56664 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_04.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Append Attributes With Params", + "Create Initial Entity", + "Delete Initial Entity" + ], + "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..37db679d78b72be5f5b0770786f5435cf6e0316e --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "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..4fcaa02264060e236897ca761e20c09683f4f3e1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_01.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.6.2" + ], + "pics_selection": "", + "keywords": [ + "Update Attributes", + "Delete Initial Entities", + "Initialize Test" + ], + "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..1817dff3ede04a37cb60735f5e04eaf3e19d58c9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_02.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.2" + ], + "pics_selection": "", + "keywords": [ + "Update Attributes", + "Initialize Environment", + "Delete Entity" + ], + "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..007b5ef96ec4f8aae6f768233702bc4e580a8784 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.2" + ], + "pics_selection": "", + "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..1f8af27636fcd0367dbe01438d31d7594dd45391 --- /dev/null +++ b/doc/files/ContextInformation/Provision/011_04.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_04", + "test_objective": "Check that you cannot update entity attributes with invalid request body", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.6.2" + ], + "pics_selection": "", + "keywords": [ + "Update entity attributes with invalid entity fragments", + "Initialize Environment" + ], + "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..2625f86c26f701837e7134efb3a18c7554fd42cd --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_01.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.4" + ], + "pics_selection": "", + "keywords": [ + "Update Attributes", + "Initiate Test Case", + "Delete Initial Entities" + ], + "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..f19a1f8e73b95e938caa39eb0067ba762c3527ab --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_02.json @@ -0,0 +1,89 @@ +{ + "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", + "clauses": [ + "5.6.4" + ], + "pics_selection": "", + "keywords": [ + "Update Attributes", + "Setup Initial Entity", + "Delete Initial Entity" + ], + "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..ae5e3e0ba302c31b4f7e43885b91844e75407ab9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_03.json @@ -0,0 +1,89 @@ +{ + "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", + "clauses": [ + "5.6.4" + ], + "pics_selection": "", + "keywords": [ + "Partial Update Attributes", + "Create Initial Entity", + "Delete Initial Entity" + ], + "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..5234a8e86731865b2eadad26a2fd5e1f82d2596d --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_01.json @@ -0,0 +1,70 @@ +{ + "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", + "clauses": [ + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Attributes", + "Delete Initial Entities" + ], + "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..28b4b159d1321d8441b8c39175c987fb64351a8a --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_02.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Attributes", + "Create Initial Entity", + "Delete Initial Entity" + ], + "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_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": "Create 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 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": "Create 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 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": "Create 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 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..0a1e8492ea0627f0b6064e69f9e52c20c75f74dd --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_03.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Attributes", + "Setup Initial Entity", + "Delete Initial Entity" + ], + "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..681f9fa436e9af3c6882b79f3a9eeb6e724bc5b1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.12" + ], + "pics_selection": "", + "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..664ce732ee69616e413b47c781784081013ea8a9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_02.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.6.12" + ], + "pics_selection": "", + "keywords": [ + "Add Attribute To Temporal Entity" + ], + "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..32ea1f708a88969db338406488c44bb93f748d1f --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.12" + ], + "pics_selection": "", + "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..95c7401a762ca57278ed8cc1a3cabb09cb4a73d4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/014_04.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.6.12" + ], + "pics_selection": "", + "keywords": [ + "Add an Attribute To a Temporal Entity From File", + "Initialize Test Case" + ], + "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..131d2e6716286268d831eda49eaeb95f5736fea2 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_01.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.6.13" + ], + "pics_selection": "", + "keywords": [ + "Delete Attribute From A Temporal Entity", + "Initialize Setup", + "Delete Temporal Entity" + ], + "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..5cfa718914677f0010f4af21e81a49458484f5d5 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_02.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.6.13" + ], + "pics_selection": "", + "keywords": [ + "Delete attribute from temporal entity with unknow entity/attribute id", + "Create Temporal Entity", + "Delete Temporal Entity" + ], + "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..75dfd73098e88b74f7b34bc6847c2a2ad47dd4a9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/015_03.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.6.13" + ], + "pics_selection": "", + "keywords": [ + "Delete An Attribute", + "Create Id", + "Delete Temporal Entity" + ], + "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..b652c642711070de788f437d9a5ec052877ee2a9 --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.14" + ], + "pics_selection": "", + "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..20aeedda033d1a667e3bf09d2d90f9619327c912 --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_02.json @@ -0,0 +1,122 @@ +{ + "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", + "clauses": [ + "5.6.14" + ], + "pics_selection": "", + "keywords": [ + "Modify Attribute Instance Temporal Entity", + "Create Id", + "Delete Temporal Entity" + ], + "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..9eacd7f3a760e218647fc4d6fea1b40b50f10892 --- /dev/null +++ b/doc/files/ContextInformation/Provision/016_03.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.6.14" + ], + "pics_selection": "", + "keywords": [ + "Modify Attribute Instance Temporal Entity", + "Create Id", + "Delete Temporal Entity" + ], + "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..9f8a83372570fecc8610a10f9eab94df474c39a1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.6.15" + ], + "pics_selection": "", + "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..26fe5e09ee8448458be01808aba0c879eac5ce45 --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_02.json @@ -0,0 +1,105 @@ +{ + "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", + "clauses": [ + "5.6.15" + ], + "pics_selection": "", + "keywords": [ + "Delete attribute instance", + "Create Temporal Entity", + "Delete Temporal Entity" + ], + "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..65e268291bcf61f614e118763c494a64ef4d4000 --- /dev/null +++ b/doc/files/ContextInformation/Provision/017_03.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.6.15" + ], + "pics_selection": "", + "keywords": [ + "Delete An Attribute Instance", + "Create Id", + "Delete Initial Temporal Representation Of Entity" + ], + "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 Initial 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 Initial 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 Initial 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..9d5d377dc74a9f3953a357e3ed3ffab89bdcba17 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.8.1" + ], + "pics_selection": "", + "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}' list of keys\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..7320713546fd5a6c3d8bb1ad97e5b379afd62a47 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_02.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.8.1" + ], + "pics_selection": "", + "keywords": [ + "Create Subscription With Invalid Request" + ], + "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..b9c49e57acc0e2960721d985be1a26da60d4341e --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_03.json @@ -0,0 +1,54 @@ +{ + "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", + "clauses": [ + "5.8.1" + ], + "pics_selection": "", + "keywords": [ + "Create Subscription With Invalid/Empty Id", + "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..22fcf02aaf437747262daacba46fed0287a3db0b --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_04.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.8.1" + ], + "pics_selection": "", + "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/028_05.json b/doc/files/ContextInformation/Subscription/028_05.json new file mode 100644 index 0000000000000000000000000000000000000000..3931ff5eeb2bbbbc316487f0ef3610ccdd7b48e6 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/028_05.json @@ -0,0 +1,55 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/028_05", + "test_objective": "Check that you cannot create a subscription with invalid throttling", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.8.1" + ], + "pics_selection": "", + "keywords": [ + "Create Subscription With Invalid Throttling" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "028_05_01 ThrottlingAndTimeIntervalConjunction", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_05_01", + "doc": "Check that you cannot create a subscription with invalid throttling", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid Throttling", + "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-invalid-throttling-timeInterval-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "028_05_02 NegativeThrottling", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/028_05_02", + "doc": "Check that you cannot create a subscription with invalid throttling", + "tags": [ + "sub-create", + "5_8_1" + ], + "setup": null, + "teardown": null, + "template": "Create Subscription With Invalid Throttling", + "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-invalid-negative-throttling-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "subscriptions/" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Subscription/CreateSubscription", + "robotfile": "028_05" +} \ 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..1365a18e00345eb2ddc5d6d6346daf88979f9a56 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_01.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "keywords": [ + "Update Subscription With Non present Or Invalid Id" + ], + "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..7c3cc63f3762636b4830267a92e29796b2ac6bd6 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..00b7127be04211149f6bc8c42e066a64b1e28296 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..65656cba49ef997983a27cf0eb5cc07941e60c2f --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..d78e291b961188112be50705f860ea055d258b22 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_05.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..af9661f423b630586c3e19bb378c7589a2818563 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_06.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..8d0133d92fd67a4a17db8d6ffb6bb6b43b72a4a6 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_07.json @@ -0,0 +1,39 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "keywords": [ + "Activate Paused Subscription With isActive Member", + "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..7e10a5ad22f7aa9406f3ca847d77673675f96393 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_08.json @@ -0,0 +1,39 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "keywords": [ + "Activate Paused Subscription With isActive And ExpiresAt Members", + "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..a0a1d90bfee7e48ff2fcd43686cd06a4a4074956 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_09.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..31d61e31e2f8c4cec70366b56d910a5ea6a3cad3 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_10.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..0fceb80bf8e735749f384375fdacfb5078396d09 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/029_11.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.2" + ], + "pics_selection": "", + "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..d7c80d4d3902792d722a8ea4be95689c93ff6391 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.8.3" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Subscription With Invalid Id" + ], + "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..216727830d2e9d0a87c8e7ecda8797d93c739f7c --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.8.3" + ], + "pics_selection": "", + "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..fe35856a547707c120fea7acda0bb9847797b978 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/030_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.3" + ], + "pics_selection": "", + "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..1e3423cfba51657ee931521a7f93f00ad235a12d --- /dev/null +++ b/doc/files/ContextInformation/Subscription/031_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.4" + ], + "pics_selection": "", + "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..834e05028ea4dde37aa1bc28d2552025ab55381c --- /dev/null +++ b/doc/files/ContextInformation/Subscription/031_02.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.8.4" + ], + "pics_selection": "", + "keywords": [ + "Query Subscriptions With Limit And Page Parameters", + "Setup Initial Subscriptions", + "Delete Initial Subscriptions" + ], + "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..ddb2b395f4f1c53b4334165a91a8e1d6757f17ff --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_01.json @@ -0,0 +1,56 @@ +{ + "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", + "clauses": [ + "5.8.5" + ], + "pics_selection": "", + "keywords": [ + "Delete Subscription With Non present Or Invalid Id" + ], + "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..0940713dfbaaf3d680678fb4642ecb46e300fb45 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.8.5" + ], + "pics_selection": "", + "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..d3b1b4df3904a170807cf5a304572ba09c4c0827 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/032_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.8.5" + ], + "pics_selection": "", + "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..071cbf6e562ffda5370bab7f45f3c8c59a0edf4f --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_01.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Add Initial Entity", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..79698d74645296cfb83dd308711caa8f232b78ab --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_02.json @@ -0,0 +1,41 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..a2bcfc3ce064e8e57e67d7809ed8ba0465a2e8e4 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_03.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Add Initial Entity", + "Delete Initial Entity" + ], + "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": [ + "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..2883f38f2a35c2137f1c16ca397a20c6354ffa6a --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_04.json @@ -0,0 +1,41 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..26c22b272bfe0c4e4fe12ff263e1926805953141 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_05.json @@ -0,0 +1,41 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..82b54629c779cccaf2d4578cbe8108de66f46349 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_06.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "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": [ + "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..462151ecdf53ed005a08e2284f65edfd5cb3bed4 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_07.json @@ -0,0 +1,74 @@ +{ + "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 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Suite", + "Setup Initial Subscriptions", + "After Test", + "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": [ + "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": [ + "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": [ + "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..b459a48b132fc6208ff55ad65b81df1e6b5f916e --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_08.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Suite", + "Setup Initial Subscriptions", + "After Test", + "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": [ + "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": [ + "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..b4ac464f56e87ad8a9530f7d81d196419a2c08a9 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_09.json @@ -0,0 +1,41 @@ +{ + "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.receiverInfo 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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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.receiverInfo 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": [ + "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..ddcd0ea213472f76b0a00ad3819a76bde8451d78 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_10.json @@ -0,0 +1,41 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..3b2672b7259578ce66834792c38f904f899bf1db --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_11.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "Add Initial Entity", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "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": [ + "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..27f3def598abd0f993df4a05a92b23f9b652fb1e --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_12.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions", + "Before Test", + "After Test", + "Add Initial Entity", + "Delete Initial Entity" + ], + "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": [ + "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..05648962a40a7d197a83a03a2377feee72fd2f3d --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_13.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Subscription", + "Delete Initial Subscription", + "Add Initial Entity", + "Delete Initial Entity", + "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": [ + "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..ecc4b7a157b70c61572546e94e7086facb416dfe --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_14.json @@ -0,0 +1,42 @@ +{ + "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", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Subscriptions", + "Delete Initial Subscriptions", + "Before Test", + "After Test", + "Add Initial Entity", + "Delete Initial Entity" + ], + "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": [ + "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/ContextInformation/Subscription/046_15.json b/doc/files/ContextInformation/Subscription/046_15.json new file mode 100644 index 0000000000000000000000000000000000000000..39a82438d11afd3c680c4fa8e37ea86c75a02f00 --- /dev/null +++ b/doc/files/ContextInformation/Subscription/046_15.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/SUB/046_15", + "test_objective": "If a Subscription defines a throttling member, a Notification shall not be sent if the throttling specified (in seconds) has not elapsed yet.", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.8.6", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.8.6" + ], + "pics_selection": "", + "keywords": [ + "Before Test", + "Setup Initial Subscriptions", + "After Test", + "Delete Initial Subscriptions", + "Delete Initial Entity" + ], + "teardown": "After Test", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "046_15_01 Check that a notification is not sent if the throttling has not elapsed yet", + "permutation_tp_id": "TP/NGSI-LD/CI/SUB/046_15_01", + "doc": "If a Subscription defines a throttling member, a Notification shall not be sent if the throttling specified (in seconds) has not elapsed yet.", + "tags": [ + "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 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/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_15" +} \ 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..2d250319851588911a2693988b82d237c2238b61 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_01.json @@ -0,0 +1,37 @@ +{ + "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 a valid URI", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.10.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.10.1" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Context Source Registration With An Invalid Id" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "036_01_01 Invalid 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 a valid URI", + "tags": [ + "5_10_1", + "csr-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Context Source Registration With An 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": [], + "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..7fdb0c225974febeacb0ee10202086a8dbb7b811 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.10.1" + ], + "pics_selection": "", + "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..c26feed2107eb02b3ac22c0ea75a5bbaabb0a973 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.10.1" + ], + "pics_selection": "", + "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..ecb8262c05d8a18ae7dd9529ac84854167e63c39 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.10.1" + ], + "pics_selection": "", + "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..ffafda1785d6d838e567d3483f7e28e4ca879800 --- /dev/null +++ b/doc/files/ContextSource/Discovery/036_05.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Review JSON-LD resolution when retrieving a context source registration", + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "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..a82a652afa2ab14569995bfc0f603ef60da2816e --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_01.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query A Context Source Registration", + "Setup Initial Context Source Registrations", + "Delete Created Context Source Registrations" + ], + "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..301245e49c8c918b8bc053a2c358e5e67117d30f --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "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..67ff1c1ca2c727507a032d163d8c703a23386831 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_03.json @@ -0,0 +1,87 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration With Invalid Query Param" + ], + "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..6154795ef7aca645186c65a3bba2b6855d5d1247 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "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..b0c56e2763fa34f97f58a239d9083bee12381d15 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_05.json @@ -0,0 +1,54 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Matching EntityInfo of RegistrationInfo", + "Delete Created Context Source Registration" + ], + "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 'OffStreetParking' and\n Query Parameter: idPattern set to '.*downtown$'\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 'OffStreetParking' and\n Query Parameter: idPattern set to '.*downtown$'\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..d17fa84d45db861b17b3348153ddedef3b2da4e9 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_06.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo", + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "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..6ee6113d454bb02e39642e7046ab2963420fa936 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_07.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Matching Geoquery", + "Setup Initial Context Source Registration", + "Delete Created Context Source Registration" + ], + "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 '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}'\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 'within' 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],[-15.23,21.37]]' and\n Query Parameter: geoproperty set to 'location'\n}", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "when" + ], + "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..7e0bafd8d4d508b94182a1f8993420535fe4b876 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_08.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "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..28889eade603ea25caae0fe1431ce8e8422b7c33 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_09.json @@ -0,0 +1,88 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Matching Temporal Query", + "Delete Created Context Source Registrations" + ], + "teardown": "None", + "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": "Delete Created Context Source Registrations", + "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": "Delete Created Context Source Registrations", + "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": "Delete Created Context Source Registrations", + "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": "Delete Created Context Source Registrations", + "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..3373dd1ae94adb3e31b17e5df77c5aaeba492588 --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_10.json @@ -0,0 +1,57 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration With Query Params", + "Setup Initial Context Source Registrations", + "Delete Created Context Source Registrations" + ], + "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 'csourceProperty1==\"aValue\"'\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..0f38d5889275ab211e2a10ae3b3547c64da0841f --- /dev/null +++ b/doc/files/ContextSource/Discovery/037_11.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.10.2" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration With Limit And Offset Parameters", + "Setup Initial Context Source Registrations", + "Delete Created Context Source Registrations" + ], + "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 Offset 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: offset 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 Offset 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: offset 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 Offset 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 '${2}' 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: offset set to '${0}'\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..053574567f3309a73a00e408bf67bb3c96095220 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.9.2" + ], + "pics_selection": "", + "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}' list of keys\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..e00e099399e47a53b0837bd527d6053b841c3286 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.9.2" + ], + "pics_selection": "", + "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}' list of keys\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..ea4a3ea25cd9106e560b79414481bf1c23c12493 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_01_03.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.9.2" + ], + "pics_selection": "", + "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 Specifying an 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}' list of keys\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..14ad917156bef22efd61b75019499498eef531d6 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.9.2" + ], + "pics_selection": "", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an 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..dd088e3f34e5611648b20fd8b4a98023603622ba --- /dev/null +++ b/doc/files/ContextSource/Registration/033_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.9.2" + ], + "pics_selection": "", + "keywords": [ + "Delete Created Context Source Registrations", + "Create New Context Source Registration" + ], + "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..2950b63128f68541da7e80ccd557e23c51005744 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_04.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..66e4181fee05ecac660ac2c8efb288463f9234a5 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_05.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..e112c212222897a0c058939b60f145c1c56767e3 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_06.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..d73c52538f99d30d9a09e7c46400ddfc0d6d5427 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_07.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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 'Vehicle'\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#Vehicle'\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..c8d3de2e11dabe9dce473f3d2329c6f3b5f94c99 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_08.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..bddb1401ef266974e59dc9e530cfc4883a13b03b --- /dev/null +++ b/doc/files/ContextSource/Registration/033_09.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "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..4abc3f9f32d4014ffd828f5034bc23e1abf111b7 --- /dev/null +++ b/doc/files/ContextSource/Registration/033_10.json @@ -0,0 +1,53 @@ +{ + "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", + "clauses": [ + "6.3.5" + ], + "pics_selection": "", + "keywords": [ + "Create Context Source With Invalid Content" + ], + "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 CSourceRegistration 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..0662d55b3824a749828aca404726cdec5d508eb9 --- /dev/null +++ b/doc/files/ContextSource/Registration/034_01.json @@ -0,0 +1,39 @@ +{ + "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", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "keywords": [ + "Update A Context Source", + "Delete Updated Context Source Registration", + "Initialize the Test Case" + ], + "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 Retrieve Context Source Registration with Response Body containing the key '['endpoint']', with the value 'http://my.new.csource.org:1026'\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/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..7cf68cb546d78bcd0fd1051ee4c8b918357f0a7d --- /dev/null +++ b/doc/files/ContextSource/Registration/034_02.json @@ -0,0 +1,73 @@ +{ + "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", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "keywords": [ + "Update A Context Source", + "Create Initial Context Source Registration", + "Delete Initial Context Source Registration" + ], + "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 a valid URI", + "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 reason set to 'Bad Request' and\n Update Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 'invalidURI' 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 if the request body is not of the same data type", + "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 reason set to 'Bad Request' and\n Update Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 '${valid_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 you attempt to remove a mandatory property", + "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 reason set to 'Bad Request' and\n Update Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 '${valid_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": [ + "when" + ], + "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..0ee6265171c169c1d3ec1be175b4fc91ce22bf47 --- /dev/null +++ b/doc/files/ContextSource/Registration/034_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "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 reason set to 'Not Found' and\n Update Context Source Registration With Return with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..20c777a389df6ebb044f71a2ef3c9058709e2a4b --- /dev/null +++ b/doc/files/ContextSource/Registration/034_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Context Source Registration", + "Delete Initial Context Source Registration" + ], + "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 From File with Response Status Code set to 400 and\n Update Context Source Registration From File with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Update Context Source Registration 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/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 from file 'context-source-registration-invalid-json-sample.json'\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/034_05.json b/doc/files/ContextSource/Registration/034_05.json new file mode 100644 index 0000000000000000000000000000000000000000..6b33de7e45956bc2c664b00327bd25b215b1c94a --- /dev/null +++ b/doc/files/ContextSource/Registration/034_05.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_05", + "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", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "keywords": [ + "Update A Context Source", + "Delete Updated Context Source Registration", + "Initialize the Test Case" + ], + "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_05_01 Update a context source registration to never expire", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_05_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 Retrieve Context Source Registration with Check that response body does not contain the key '$.expiresAt'\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/json'\n}", + "http_verb": "PATCH", + "endpoint": "csourceRegistrations/{registration_id}" + } + ], + "permutations": [], + "robotpath": "ContextSource/Registration/UpdateContextSourceRegistration", + "robotfile": "034_05" +} \ No newline at end of file diff --git a/doc/files/ContextSource/Registration/034_06.json b/doc/files/ContextSource/Registration/034_06.json new file mode 100644 index 0000000000000000000000000000000000000000..af0989b7ae446ec0473205a847c193a363382097 --- /dev/null +++ b/doc/files/ContextSource/Registration/034_06.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CS/REG/034_06", + "test_objective": "Check that you cannot update a context source registration if the Id is not present", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.3", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.9.3" + ], + "pics_selection": "", + "keywords": [ + "Update A Context Source", + "Create Initial Context Source Registration", + "Delete Initial Context Source Registration" + ], + "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_06_01 Update a context source registration by id if the Id is not present", + "permutation_tp_id": "TP/NGSI-LD/CS/REG/034_06_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 405 and\n Update Context Source Registration With Return with Response reason set to 'Method Not Allowed' and\n Update Context Source Registration With Return with Response does not contain a body\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 '${EMPTY}' 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_06" +} \ 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..862796196171383915ddcdb1a372f96f65d87e6a --- /dev/null +++ b/doc/files/ContextSource/Registration/035_01.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.9.4" + ], + "pics_selection": "", + "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..731ac71f426c0383759fe8c5c0b41a66b83ae567 --- /dev/null +++ b/doc/files/ContextSource/Registration/035_02.json @@ -0,0 +1,58 @@ +{ + "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", + "clauses": [ + "5.9.4" + ], + "pics_selection": "", + "keywords": [ + "Delete A Context Source", + "Delete Created Context Source Registrations", + "Create Initial Context Source Registration" + ], + "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 405 and\n Delete Context Source Registration With Return with Response Body containing the type '${EMPTY}' 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 the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' 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": [ + "then", + "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..0d2b6622cdf58cff89ba8e4ea3fd6110402c397c --- /dev/null +++ b/doc/files/ContextSource/Registration/035_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.9.4" + ], + "pics_selection": "", + "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..5577c37f9ae0c56747fa12c1ae0de74d21f1294d --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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}' list of keys and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastNotification' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastFailure' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastSuccess' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'timesSent'\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..888112f1ba1fce0cc53f792a409e20f7f8521492 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_02.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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 Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\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..6f871040125c333b585fc2602f596f3d91d1619b --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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..aa2b859b1d9d0c1b408077f2279af5496768302b --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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 that the payload body contains a boolean attribute with name 'expected_attribute_name=isActive' and value 'expected_attribute_value=False 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..beba14053f93bbd08e4ab74c0df8cc8d0c719063 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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 that the dictionary contains the key 'key=expiresAt' with type DateTime and value set to 'expected value=${expiresAt}' 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..9a9b86a3a26ec417fd1df77391d6fff6a5df1d4f --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_06.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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..e5ba028e82d6022f2be3feaf819671124351131a --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_07.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Initial Context Source Registration Subscription" + ], + "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 'problem_type=${ERROR_TYPE_ALREADY_EXISTS}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..95d167e4e6420843743232e41dba4eb13aa0192e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_08.json @@ -0,0 +1,85 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "keywords": [ + "Create Invalid Context Source Registration Subscription" + ], + "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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..6748811d376c7ef1ef2c3806af0260408ba12f97 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/038_09.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.2" + ], + "pics_selection": "", + "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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..c6a334e7fa42b462df762cf79eedf0261e2d5dc2 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.3" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscriptions", + "Delete Initial Context Source Registration Subscriptions" + ], + "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 Update Context Source Registration Subscription with Response does not contain a body and\n Update Context Source Registration Subscription with Response reason set to 'No Content' 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..73db9e13ba6d8d9251a6e2d728d92d34de986796 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.3" + ], + "pics_selection": "", + "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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..2d7b050c2ea2cfd57100b46d3fc3ab8706801c45 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.3" + ], + "pics_selection": "", + "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 'problem_type=${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..77004d5d570af278f40d684c4e6c08071a325248 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_04.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.11.3" + ], + "pics_selection": "", + "keywords": [ + "Update Context Source Registration Subscription With Invalid Fragment", + "Setup Initial Context Source Registration Subscriptions", + "Delete Initial Context Source Registration Subscriptions" + ], + "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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..07f28243dd248d1989ce8076078ae723993a3580 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/039_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.3" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscriptions", + "Delete Initial Context Source Registration Subscriptions" + ], + "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 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..43c2dba440f090ec986a6ee50ed237e025c9eaf0 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.4" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration Subscription" + ], + "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 reason set to 'OK' and\n Retrieve Context Source Registration Subscription with The response headers Link is set to 'expected_link_header=${expected link header}' and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'expectation_payload' and\n Query Parameter: 'response_body' set to 'response.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes' list of keys and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastNotification' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastFailure' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastSuccess' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'timesSent'\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..88036ffc8a4e9c3ad76f98b2fd4e2d7e3685ced8 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.4" + ], + "pics_selection": "", + "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 reason set to 'Bad Request' and\n Retrieve Context Source Registration Subscription with Response Header: Content-Type set to application/json and\n Retrieve Context Source Registration Subscription with Response Body containing the type 'problem_type=${ERROR_TYPE_BAD_REQUEST_DATA}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..90ba05c28dcac410e219d2a0921e2acb91593a4d --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/040_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.4" + ], + "pics_selection": "", + "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 reason set to 'Not Found' and\n Retrieve Context Source Registration Subscription with Response Header: Content-Type set to application/json and\n Retrieve Context Source Registration Subscription with Response Body containing the type 'problem_type=${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\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..b6d4be4bd6b5c566d66556594287e050a7b600b5 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.5" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "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 Subscriptions", + "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..d598284644c62591f8f02cad7866c2be3ffe2fb0 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_02.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.11.5" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Subscriptions With Limit Parameter", + "Setup Initial Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "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..b958bcbe02d9a66da80d7ccf349d4ab30aa3eacc --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_03.json @@ -0,0 +1,74 @@ +{ + "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", + "clauses": [ + "5.11.5" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Subscriptions With Limit And Page Parameters", + "Setup Initial Context Source Registration Subscriptions", + "Delete Created Context Source Registration Subscriptions" + ], + "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.headers}'\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.headers}'\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.headers}'\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..91af96dd0e752818d44faa68c1f426ebbb22b01d --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/041_04.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.11.5" + ], + "pics_selection": "", + "keywords": [ + "Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters" + ], + "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..8a8e6d08f21a523d3c013482de4c14a0d806c115 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_01.json @@ -0,0 +1,37 @@ +{ + "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", + "clauses": [ + "5.11.6" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription" + ], + "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..8bf07a32b7d867fabe720f4407f1ff879505b5c9 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_02.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.6" + ], + "pics_selection": "", + "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..aa2d9bc4dc6a96243de9c807029da9912759d254 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/042_03.json @@ -0,0 +1,35 @@ +{ + "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", + "clauses": [ + "5.11.6" + ], + "pics_selection": "", + "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..93ab9ed403c40e974e5cd67c5ce86c8c31bd02df --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_01.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "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..c405b7248012b543341466795db0d4b4c14d2b8f --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_02.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Context Source Registration and Context Source Registration Subscription", + "Delete Created Context Source Registration And Context Source Registration Subscription" + ], + "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..817b160894d56ea73b93710a7c689265270b8844 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_03.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..7f32eb37bd22a66fe44c3e18c479348e89e5f5eb --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_04.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..682659b16ca21f38fb8d6b48fed1431b34804022 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_05.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..05cfa6750d051b7e436afd9b47a3f6c6b8707f7f --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_06.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..6dac13941d3ab7820ce600ca18b52fcac5613a88 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_07.json @@ -0,0 +1,55 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Do Not Receive cSourceNotification If Subscription Status Is Not Active", + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..699b06db54b0843fced8cfdc7d978790a1348c78 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_08.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Context Source Registration and Context Source Registration Subscription", + "Delete Created Context Source Registration And Context Source Registration Subscription" + ], + "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..470a2c0c60fed1474319cabcfd316020f92a8cdb --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_09.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "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..7e7361bf7c446c980e968422f0f15c8c2d61fe96 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_10.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..a123f8d0a3c7218cfbf48cd8811793b34e6eee24 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_11.json @@ -0,0 +1,54 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Receive cSourceNotification For Matching Context Source Registrations On Management Interval", + "Delete Created Context Source Registrations" + ], + "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..b534313d8a20fdb737a12b4cae5d4e1542a72d6e --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_12.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..958d298460cce4520f19602883a43194ca7df346 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_13.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..be0566f787406cfa8c2c26b01c9c5c8d0c2b5c04 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_14.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..2516acf15c0245fc1a0c0e307b147467bef08ec5 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_15.json @@ -0,0 +1,38 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Setup Initial Context Source Registration Subscription", + "Delete Created Context Source Registration And Subscription" + ], + "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..2c6919213e59801bb0b990e6e9166731a5ab3149 --- /dev/null +++ b/doc/files/ContextSource/RegistrationSubscription/047_16.json @@ -0,0 +1,71 @@ +{ + "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", + "clauses": [ + "5.11.7" + ], + "pics_selection": "", + "keywords": [ + "Receive cSourceNotification For Newly Matching Context Source Registrations", + "Create Initial Context Source Registrations And Context Source Registration Subscription", + "Delete Created Context Source Registrations And Context Source Registration Subscription" + ], + "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..c33d4a12c13443e3480356a99501ec2c96ce045b --- /dev/null +++ b/doc/generateDocumentationData.py @@ -0,0 +1,61 @@ +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() + info["error_while_autogenerating"] = "no error" + except Exception as e: + print("WHILE GENERATING ROBOT DATA:", e) + info = dict() + info["error_while_parsing"] = True + info["error_while_autogenerating"] = str(e) + 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..35b53130a091ab4e678f4d440b9a2de6e8f0dce2 --- /dev/null +++ b/doc/statisticsDocumentationData.py @@ -0,0 +1,201 @@ +from generateDocumentationData import create_json_of_robotfile +from os.path import dirname +from os import walk +import requests +import json +import re + +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" + BASE_URL_OF_FORGE="https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/blob/tests-up-to-1_5/TP/NGSI-LD/" + + 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 + # we create a dummy entry in the "sub" test_cases, which has a "permutation_tp_id" equal to the robotfile + # We do not forget to add a trailing slash that will be removed later, and a tail _XX which will + # allow matching from the googlesheet? + json_of_test_case["test_cases"] = [{"permutation_tp_id":"/"+json_of_test_case["robotfile"]+"_XX"}] + else: + statistics[name_of_test_case]["failed"] = False + number_of_successes += 1 + # we add it here because Fernando's code does not, in case of successfull parsing + json_of_test_case["error_while_parsing"] = False + # establish the right configuration + if json_of_test_case["robotpath"].startswith("ContextSource"): + json_of_test_case["config_id"] = "CF_05" + else: + json_of_test_case["config_id"] = "CF_01" + # upgrade the version and add the reference in square brackets + json_of_test_case["reference"] = re.sub(r"V1.3.1 \[\]", "version 1.5.1 [1]", json_of_test_case["reference"]) + # now for each permutation inside this test case, create the permutation's correct parent_release + if "test_cases" in json_of_test_case: + # grab everything that is a permutation_body inside the "sub" test_cases, + for permutation_body in json_of_test_case["test_cases"]: + # default parent release + parent_release = "v1.3.1" + for tag in permutation_body["tags"]: + if tag.startswith('since_'): + parts = tag.split('_') + # the suffix + parent_release = parts[-1] + permutation_body["permutation_parent_release"] = parent_release + else: + print("NO PERMUTATIONS in TESTCASE??? " + json_of_test_case["tp_id"]) + exit(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("testcases.json", 'w') as fp: + json.dump(obj=testcases, indent=2, fp=fp) + + # determine the structure/schema of a successfully parsed testcase + permutation_template = {} + for testcase in testcases: + if testcase["error_while_parsing"] == False: + permutation_metadata_template = {} + # everything that is at the top level shall be extracted + for key, value in testcase.items(): + if key != "test_cases": + if type(key) is str: + permutation_metadata_template[key] = "UNKNOWN" + elif type(key) is list: + permutation_metadata_template[key] = [] + elif type(key) is int: + permutation_metadata_template[key] = 0 + elif type(key) is float: + permutation_metadata_template[key] = 0.0 + elif type(key) is dict: + permutation_metadata_template[key] = {} + else: + print("UNKNOWN type") + exit(1) + if "test_cases" in testcase: + # everything that is a permutation_body inside the "sub" test_cases, + # shall rise on its own existenz and be joined with its permutation_metadata + for permutation_body in testcase["test_cases"]: + permutation_body_template = {} # new object, not changing permutation_body + if "permutation_tp_id" in permutation_body: + permutation_body_template["stripped_permutation_tp_id"] = "UNKNOWN" + permutation_body_template["robotlink"] = "UNKNOWN" + for key, value in permutation_body.items(): + if type(key) is str: + permutation_body_template[key] = "UNKNOWN" + elif type(key) is list: + permutation_body_template[key] = [] + elif type(key) is int: + permutation_body_template[key] = 0 + elif type(key) is float: + permutation_body_template[key] = 0.0 + elif type(key) is dict: + permutation_body_template[key] = {} + else: + print("UNKNOWN BODY type") + exit(1) + # we use the unpacking python operator ** that strips the container dict from both + permutation_template = {**permutation_metadata_template, **permutation_body_template} + else: + print("NO PERMUTATION TP ID") + exit(1) + else: + print("TEMPLATE PARSING NOT FAILED, BUT no permutations??") + exit(1) + if permutation_template != {}: + break + + print() + print("Typical template:") + print(permutation_template) + + # unpack all permutations of testcases that are under the same .robot file + permutations = [] + for testcase in testcases: + #print("--parsing "+testcase["robotfile"]) + permutation_metadata = {} + # everything that is at the top level shall be extracted + for key, value in testcase.items(): + if key != "test_cases": + permutation_metadata[key] = value + # start creating HTML link to robot file in repo + fullurl = BASE_URL_OF_FORGE + permutation_metadata["robotpath"] + "/" + permutation_metadata["robotfile"] + ROBOT_FILE_EXTENSION + if "test_cases" in testcase: + # everything that is a permutation_body inside the "sub" test_cases, + # shall rise on its own existenz and be joined with its permutation_metadata + for permutation_body in testcase["test_cases"]: + if "permutation_tp_id" in permutation_body: + ptpid = permutation_body["permutation_tp_id"] + if "then" not in permutation_body: + print(" no then in " + ptpid) + if "when" not in permutation_body: + print(" no when in " + ptpid) + #print("::: "+ptpid) + # strip from beginning up to including the last "/" + permutation_body["stripped_permutation_tp_id"] = ptpid[ptpid.rindex("/")+1:] + # use the stripped_permutation_tp_id as text of the link + permutation_body["robotlink"] = "" + permutation_body["stripped_permutation_tp_id"] + "" + # So basically we append to the permutations a new dict that is the | union merge of the + # items of the template merged with the items of the concatenation of {**permutation_metadata, **permutation_body} + # For this last concatenation we use the unpacking python operator ** that strips the container dict from both + #permutations.append(dict(permutation_template.items() | {**permutation_metadata, **permutation_body}.items())) + a = {**permutation_metadata, **permutation_body} + unpacked_testcase = {**permutation_template, **a} + # Perform a check on the clauses that must be equal to the + # clauses extracted from tags + if "clauses" not in unpacked_testcase: + print("NO EXTRACTED CLAUSES in " + ptpid) + exit(1) + if len(unpacked_testcase["clauses"]) > 1: + print("MULTIPLE CLAUSES in " + ptpid) + permutations.append(unpacked_testcase) + else: + print("NO PERMUTATION TP ID") + exit(1) + else: + # there is no "sub" test_cases, it likely is a failed parsing + if testcase["error_while_parsing"] == False: + print("PARSING NOT FAILED, BUT no permutations??") + exit(1) + + + + + + with open("permutations.json", 'w') as fp: + json.dump(obj=permutations, indent=2, fp=fp) + + # The URL of the REST endpoint of the NoSQL database + dburl = 'http://ec2-18-153-159-20.eu-central-1.compute.amazonaws.com:5555/fromrobot' + requests.delete(dburl) + # Set the appropriate headers for JSON, if required by the endpoint + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + # Include any other headers the API requires + } + # Make the POST request + response = requests.post(dburl, data=json.dumps(permutations), headers=headers) 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..e151767e2b3955e78f5f609227f98263da46e41d --- /dev/null +++ b/doc/tests/test_CheckTests.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +from re import findall +from unittest import TestCase +from os.path import dirname, join, basename, splitext +from os import walk + + +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=f'{folder_test_suites}/TP/NGSI-LD', + extension='robot') + + self.search_lines_by_string_and_extension( + directory=f'{folder_test_suites}/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, _, 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, _, 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 = 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}' " + f"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..fc7bc65dabd370479120970ff3423a2123326a37 --- /dev/null +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -0,0 +1,463 @@ +#!/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_019_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_07.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_021_14(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_14.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_14.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..097a4a0a71db20fe54b3f209d0f85c86a7a5fd33 --- /dev/null +++ b/doc/tests/test_ContextInformation_Subscription.py @@ -0,0 +1,322 @@ +#!/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_028_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/028_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_028_05.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_046_15(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/046_15.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_046_15.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..83ad07e8cdffd49ae538d7ce30fcf878cfdc7116 --- /dev/null +++ b/doc/tests/test_ContextSource_Discovery.py @@ -0,0 +1,156 @@ +#!/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 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..3a9ddef3e9c5800c2c3f3c12ee4fe23f6dd637e3 --- /dev/null +++ b/doc/tests/test_ContextSource_Registration.py @@ -0,0 +1,190 @@ +#!/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 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' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + 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) + + def test_034_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_034_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/034_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_034_06.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..316a3204bfdc918d9a1a3fe19f94fe32cb9fed78 --- /dev/null +++ b/doc/tests/test_ContextSource_RegistrationSubscription.py @@ -0,0 +1,323 @@ +#!/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 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/assertionUtils.py b/libraries/assertionUtils.py index ae9fc0891a275e7b1a4f7885f0fb1c1fd67e33ec..edb706103142318e38b1f61e03d4241d563694b5 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -1,4 +1,4 @@ -import re +from re import compile from dataclasses import dataclass import dateTimeUtils from deepdiff import DeepDiff @@ -21,7 +21,7 @@ def wrap_context_to_list(context): return context -core_context_pattern = re.compile('https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v\d\.\d.jsonld') +core_context_pattern = compile(r'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v\d\.\d.jsonld') class AnyCoreContextVersionOperator: @@ -34,7 +34,6 @@ class AnyCoreContextVersionOperator: class StringOrSingleListContextOperator: - def match(self, level) -> bool: # The context can be at the root of the element to check... or deeper when we have list of elements # So match on the end of the path @@ -97,6 +96,7 @@ def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, ig if len(res) > 0: output_pretty_diff(expected, actual, Theme(added="", removed="", reset="")) + return res 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..7599dc9eac2dbacaedcadd6caf0d37e80c18a4c3 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.9.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/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 0fbad1d81c11a658dfec8b3bb8b3e2258942c8fd..6f3d9d02437f1bba87c0efffc3107a4f0f453bd8 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -38,6 +38,8 @@ Query Entities ... ${georel}=${EMPTY} ... ${coordinates}=${EMPTY} ... ${geometry}=${EMPTY} + ... ${count}=${EMPTY} + ... ${q}=${EMPTY} ${attrs_length}= Get Length ${attrs} ${accept_length}= Get Length ${accept} ${options_length}= Get Length ${options} @@ -77,6 +79,8 @@ Query Entities IF '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} END + IF '${count}'!='' Set To Dictionary ${params} count=${count} + IF '${q}'!='' Set To Dictionary ${params} q=${q} ${response}= GET ... url=${url}/${ENTITIES_ENDPOINT_PATH} 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/ContextSourceDiscovery.resource b/resources/ApiUtils/ContextSourceDiscovery.resource index 03b434a0bf4d7260ab18cac9e0b24963fd884d37..160f66f9cd5a7ff9334fbc14c4717522c25199a9 100755 --- a/resources/ApiUtils/ContextSourceDiscovery.resource +++ b/resources/ApiUtils/ContextSourceDiscovery.resource @@ -20,6 +20,7 @@ Query Context Source Registrations ... ${context}=${EMPTY} ... ${id}=${EMPTY} ... ${type}=${EMPTY} + ... ${idPattern}=${EMPTY} ... ${attrs}=${EMPTY} ... ${q}=${EMPTY} ... ${csf}=${EMPTY} @@ -31,7 +32,7 @@ Query Context Source Registrations ... ${timerel}=${EMPTY} ... ${timeAt}=${EMPTY} ... ${limit}=${EMPTY} - ... ${page}=${EMPTY} + ... ${offset}=${EMPTY} ... ${accept}=${EMPTY} &{headers}= Create Dictionary @@ -44,6 +45,9 @@ Query Context Source Registrations 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 '${idPattern}'!='' + Set To Dictionary ${params} idPattern=${idPattern} + END IF '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} IF '${q}'!='' Set To Dictionary ${params} q=${q} IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} @@ -65,7 +69,7 @@ Query Context Source Registrations 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} + IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} ${response}= GET ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} @@ -90,7 +94,7 @@ Query Context Source Registrations With Return ... ${timerel}=${EMPTY} ... ${timeAt}=${EMPTY} ... ${limit}=${EMPTY} - ... ${page}=${EMPTY} + ... ${offset}=${EMPTY} ... ${accept}=${EMPTY} &{headers}= Create Dictionary @@ -125,7 +129,7 @@ Query Context Source Registrations With Return 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} + IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} ${response}= GET ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index c1aca20b8617ecb33205b3d2dbaa69b15d26c70b..7aa5176bdbbe8572942d5b00830efdfa5e54ab10 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -2,6 +2,7 @@ Variables ${EXECDIR}/resources/variables.py Library ${EXECDIR}/libraries/logUtils.py Library Collections +Library OperatingSystem Library RequestsLibrary @@ -12,6 +13,7 @@ ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json ${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${response} ${EMPTY} @@ -73,6 +75,17 @@ Update Context Source Registration Output ${response} Update Context Source Registration RETURN ${response} +Update Context Source Registration From File + [Arguments] ${context_source_registration_id} ${filename} + + ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... data=${file_content} + ... expected_status=any + Output ${response} Update Context Source Registration From File + RETURN ${response} + Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} 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/ApiUtils/TemporalContextInformationConsumption.resource b/resources/ApiUtils/TemporalContextInformationConsumption.resource index e806f08574472dd610333554dfb12b3434c3a4e9..983a2be222c0e30e8c90cef133bbf445d3b9367e 100755 --- a/resources/ApiUtils/TemporalContextInformationConsumption.resource +++ b/resources/ApiUtils/TemporalContextInformationConsumption.resource @@ -37,6 +37,7 @@ Query Temporal Representation Of Entities ... ${limit}=${EMPTY} ... ${lastN}=${EMPTY} ... ${accept}=${EMPTY} + ... ${options}=${EMPTY} ${entity_types_length}= Get Length ${entity_types} ${entity_ids_length}= Get Length ${entity_ids} ${attrs_length}= Get Length ${attrs} @@ -78,6 +79,9 @@ Query Temporal Representation Of Entities Set To Dictionary ${params} geoproperty=${geoproperty} END IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${options}'!='' + Set To Dictionary ${params} options=${options} + END ${response}= GET ... url=${temporal_api_url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index a21989e9ef9c240ae6c57f0bb43ac1bd51ee61f4..f3af151f4cc61b6d980a8b9a0b9cf6f2c5e38f84 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 *** @@ -13,6 +14,11 @@ ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] ${context_regex_expr}= root\\['@context'\\] ${status_regex_expr}= root\\['status'\\] +${lastfailure_regex_expr}= root\\['lastFailure'\\] +${lastNotification_regex_expr}= root\\['lastNotification'\\] +${timesFailed_regex_expr}= root\\['timesFailed'\\] +${timesSent_regex_expr}= root\\['timesSent'\\] +${is_active_expr}= root\\['isActive'\\] *** Keywords *** @@ -42,10 +48,18 @@ Check Response Headers Containing Content-Type set to [Arguments] ${expected_content_type_content} ${response_headers} Should Be Equal ${response_headers['Content-Type']} ${expected_content_type_content} +Check Response Header is Empty + [Arguments] ${response_headers} + Dictionaries Should Be Equal ${response_headers} {} + Check Response Headers Link Not Empty [Arguments] ${response_headers} Should Not Be Empty ${response_headers['Link']} +Check Response Headers Link set to + [Arguments] ${response_headers} ${expected_link_header} + Should Be Equal ${response_headers['Link']} ${expected_link_header} + # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers @@ -59,6 +73,10 @@ Check Response Headers Containing URI set to ... ignore_order=True END +Check Response Headers Containing NGSILD-Results-Count Equals To + [Arguments] ${expected_result_count} ${response_headers} + Should Be Equal ${response_headers['NGSILD-Results-Count']} ${expected_result_count} + # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers @@ -79,6 +97,19 @@ Check Response Body Containing an Attribute set to Should Be Equal ${response_body['${expected_attribute_name}']} ${expected_attribute_value} END +Check Response Body Containing a Boolean Attribute set to + [Arguments] ${expected_attribute_name} ${response_body} ${expected_attribute_value} + Dictionary Should Contain Key ${response_body} ${expected_attribute_name} + IF '${expected_attribute_value}'=='True' + Should Be True ${response_body['${expected_attribute_name}']} + ELSE + IF '${expected_attribute_value}'=='False' + Should Not Be True ${response_body['${expected_attribute_name}']} + ELSE + Fail Unexpected boolean value, only True/False are allowed, received ${expected_attribute_value} + END + END + Check Response Body Containing Batch Operation Result [Arguments] ${expected_batch_operation_result} ${response_body} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success @@ -235,7 +266,7 @@ Check Response Body Containing Context Source Registration element ${context_source_registration_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${context_source_registration}= Update Value To JSON ... ${context_source_registration_payload} - ... $..id + ... $.id ... ${context_source_registration_id} ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys @@ -302,7 +333,7 @@ Check Response Body Containing List Containing Context Source Registrations elem FOR ${expected_context_source_registration_id} IN @{expected_context_source_registrations_ids} ${expected_context_source_registrations_payload}= Update Value To JSON ... ${expected_context_source_registrations_payload} - ... $.[${index}]..id + ... $.[${index}].id ... ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END @@ -329,6 +360,23 @@ Check Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response_body} Should Not Be Empty ${response_body['title']} +Check Response Body Containing ProblemDetails Element + [Arguments] ${response_body} ${problem_type} + Should Not Be Empty ${response_body['title']} + Should Not Be Empty ${response_body['detail']} + Should Be String ${response_body['title']} + Should Be String ${response_body['detail']} + Should Not Be Equal ${response_body['title']} ${response_body['detail']} + Should Be Equal ${response_body['type']} ${problem_type} + +Check Response Does Not Contain Body + [Arguments] ${response} + Should Not Contain ${response} body + +Check Response Reason set to + [Arguments] ${response_reason} ${reason} + Should Be Equal ${response_reason} ${reason} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response_body} ${type} ${json_response_body}= Set Variable ${response_body} @@ -344,6 +392,10 @@ Check JSON Value In Response Body [Arguments] ${json_path_expr} ${value_to_check} ${response_body} Should Be Equal As Strings ${response_body${json_path_expr}} ${value_to_check} +Check JSON Value Not In Response Body + [Arguments] ${json_path_expr} ${response_body} + Should Not Have Value In Json ${response_body} ${json_path_expr} + Check NotificationParams [Arguments] ${filename} ${expected_additional_members} ${response_body} @@ -413,3 +465,75 @@ 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} + +Check Dictionary Might Contain Additional Members of the NotificationParams + # Check the Additional Members 5.2.14.2 in the NotificationParams data structure + [Arguments] ${dictionary} ${key} + Log Dictionary Might Contain Key with a specific type + Log Dictionary: ${dictionary} + Log Key: ${key} + + ${value}= Evaluate $dictionary.get($key) + + IF '${value}' != '' and '${value}' != 'None' + IF "${key}" == "lastNotification" or "${key}" == "lastFailure" or "${key}" == "lastSuccess" or "${key}" == "expiresAt" + # Need to check that there is a DateTime value + ${type date}= Parse Ngsild Date ${dictionary}[${key}] + Should Not Be Equal + ... ${type date} + ... ${None} + ... The Additional Member ${key} contains a value (${value}) that it is not in DateTime format + END + IF "${key}" == "timesSent" or "${key}" == "throttling" or "${key}" == "timeInterval" + # Need to check that there is a Integer value + ${type int}= Evaluate type(${dictionary}[${key}]).__name__ + Should Be Equal + ... ${type int} + ... int + ... The Additonal Member ${key} contains a value (${value}) that it is not in Number format + END + IF "${key}" == "isActive" + # Need to check that there is a Boolean balue + ${type bool}= Evaluate type(${dictionary}[${key}]).__name__ + Should Be Equal + ... ${type bool} + ... bool + ... The Additonal Member ${key} contains a value (${value}) that it is not in Boolean format + END + IF "${key}" == "subscriptionName" or "${key}" == "description" or "${key}" == "q" or "${key}" == "csf" or "${key}" == "status" + # Need to check that there is a Boolean balue + ${type string}= Evaluate type(${dictionary}[${key}]).__name__ + Should Be Equal + ... ${type string} + ... str + ... The Additonal Member ${key} contains a value (${value}) that it is not in String format + END + ELSE + Log The key '${key}' is not present in the dictionary + END + +Check Response Body Contains DateTime Value + [Arguments] ${dictionary} ${key} ${expected value} + Dictionary Should Contain Key ${dictionary} ${key} + + ${obtained value}= Evaluate $dictionary.get($key) + ${date}= Parse Ngsild Date ${dictionary}[${key}] + + Should Not Be Equal + ... ${date} + ... ${None} + ... The key (${key}) contains a value (${obtained value}) that it is not in DateTime format + + Should Be Equal + ... ${expected value} + ... ${obtained value} + ... The expected value (${expected value}) is not the same as the obtained value (${obtained value}) diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index 8c68b6a0f2d1a1f76b22c033730d186068f2eb8f..b150ea68af153b75592964f19df796e90991851c 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -1,10 +1,11 @@ *** Settings *** Variables ./variables.py -Library String +Library Collections *** Keywords *** Fetch Id From Response Location Header [Arguments] ${response_headers} - ${id}= Fetch From Right ${response_headers['Location']} / + Dictionary Should Contain Key ${response_headers} Location msg=HTTP Headers do not contain key 'Location' + ${id}= Get From Dictionary ${response_headers} Location RETURN ${id} diff --git a/resources/variables.py b/resources/variables.py index 7b310bc52723b7d65084b9bd2bfd6dd08147e084..1ecd8144e9b49d886a0ef95a826d6e5035a11299 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/scripts/find_tc_using_test_data.py b/scripts/find_tc_using_test_data.py index f2f67221248cf3d0a33ed3837aa08bb11f5d8e00..56fecf5e2d6a5cdb80d1c90a65dee6e867587c09 100644 --- a/scripts/find_tc_using_test_data.py +++ b/scripts/find_tc_using_test_data.py @@ -1,20 +1,25 @@ -import os -import robot +from os import listdir +from os.path import isdir, dirname, abspath, join +from robot import run -def find_test_data_in_tc(dir, filename, run_matching_tc): - for file in os.listdir(dir): - path = dir + "/" + file - if os.path.isdir(path): - find_test_data_in_tc(path, filename, run_matching_tc) +def find_test_data_in_tc(dir_name, filename, execute): + for file in listdir(dir_name): + path = dir_name + "/" + file + if isdir(path): + find_test_data_in_tc(path, filename, execute) else: if filename in open(path).read(): - if run_matching_tc == "Y": - robot.run(path) + if execute == "Y": + run(path) print(path) if __name__ == '__main__': + # Get the folder of the tests + base_folder = dirname(dirname(abspath(__file__))) + test_suite_folder = join(base_folder, "TP") + test_data_file = input("Name of test data file to search for: ") run_matching_tc = input("Run matching Test Cases (Y/N)?: ") - find_test_data_in_tc("TP", test_data_file, run_matching_tc) + find_test_data_in_tc(dir_name=test_suite_folder, filename=test_data_file, execute=run_matching_tc) diff --git a/scripts/find_unused_test_data.py b/scripts/find_unused_test_data.py index 6a961e797ebb2aa38ec2df15d81347786f53e604..2e00342a8c9c44c0734de021737b831f4bdfdff8 100644 --- a/scripts/find_unused_test_data.py +++ b/scripts/find_unused_test_data.py @@ -1,23 +1,42 @@ -import os +from os import listdir +from os.path import isfile, isdir, dirname, abspath, join +from colorama import Fore, Style -def list_files_in_dir(dirname): - for fname in os.listdir(dirname): - if os.path.isfile(dirname + "/" + fname): - print("Looking at test data file: ", fname) - find_test_data_in_tc("TP", fname) +def list_files_in_dir(test_suite_folder, data_folder): + for filename in listdir(data_folder): + aux = join(data_folder, filename) + if isfile(aux): + print(Style.RESET_ALL) + print("Looking at test data file: ", filename) + found = find_test_data_in_tc(dir_name=test_suite_folder, filename=filename) + if not found: + print(Fore.RED + " Usage not found") + else: - list_files_in_dir(dirname + "/" + fname) + list_files_in_dir(test_suite_folder=test_suite_folder, data_folder=aux) -def find_test_data_in_tc(dir, filename): - for file in os.listdir(dir): - path = dir + "/" + file - if os.path.isdir(path): - find_test_data_in_tc(path, filename) +def find_test_data_in_tc(dir_name, filename): + found = False + for file in listdir(dir_name): + path = join(dir_name, file) + if isdir(path): + aux = find_test_data_in_tc(path, filename) + found = aux or found else: if filename in open(path).read(): - print("Found usage of", filename, "in", path) + found = True + print(Fore.GREEN + " Found usage of", filename, "in", path) + + return found + + +if __name__ == '__main__': + # Get the folder of the tests + base_folder = dirname(dirname(abspath(__file__))) + test_suite_folder = join(base_folder, "TP") + data_folder = join(base_folder, 'data') -list_files_in_dir("data") + list_files_in_dir(test_suite_folder=test_suite_folder, data_folder=data_folder) 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