diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index f91428d6e027864d85e24654e9915f63166f9b00..548f50ed276672ad79d6a33bf9ee9cf4fa05ffe1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] mandatory failing + [Tags] mandatory ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 3349a57ae1d28c1f24adb5eade162e035e33b5cc..5bad223cc708a25c8147d12622c5c07fcd6b68d8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 164e458186f21cbf8265a0e39fa27003d85611ca..534477a0b542c0597cec9542ed0ce16a421e1d7d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an atris not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index ce5a82b2c70ae4042699c8b019809576017f97af..366e21260cbc1cebdebdc40d28a25d6ff839e352 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index 8ee32f947af428438d4522fe82ccd73dc3bfd43c..d7e60109fca6d4d5c58cc1f238e6ced913d5f871 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 51685438edff33a4fb79b3e9579ab5075a3c11cf..f43a979b7e577163b77cd8e551bda34cb37f00c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -25,11 +25,13 @@ Query several entities based on ids ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index 93b9a80ce6d26f402f713c4abfcc051198034888..a4cbc5f3550d73d14ac3fd64b90eb948b817a804 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -32,11 +32,12 @@ Query several entities based on the entities types ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + #@{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} + Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index 83c5e70801703853eb2b768c4cdfa7cfd671e77f..ac17db40c9070ebd35ffd7336a760da2255d943f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -23,11 +23,11 @@ Query several entities based on the given id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} + @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index 4646d5e8d3619d514072c717c5fe1c2846885312..acde9947c31db6086cde063c7ab57a8d5c7e0989 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -6,26 +6,27 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel +${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index f04a4d400d53978aec7f4a7921619b59671edbab..e50cd66c1470ca87e49a166fe1b8aed8b263a073 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -6,15 +6,15 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 3da482558384f1ecfd9791f6835a8918479782b7..3472bedf777a24da0caccf4310133a96e86a863e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index a98e1b62ffbd854e916efff31f996cea3f49b177..228c4c846e8425158f19e7fd5a8ca4afaea82702 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 835a8d93c60788898a66a642dc41e4116d5b645e..b911217d79720a08b4aa00b18a618761ac4d8cc6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 9e2f066115efb76ff70fbdf101e5bed79aa43036..7ffd18b766f8f6c29b20e6e9f95d879328ef2d92 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -15,7 +15,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 48d63ac5e0a40ac560f4043ab42ea5bb2e407adb..36952866e33448939d64a53d7aad6367025afd95 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index d0ef11d202f08eb8ffc85537ea1f15e4d9c4d596..7b27ea33e1baffe65af76c76a5203580c44fcba7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index fbe5ef333aecb24402b167809afe4c7868f8debc..79fb860898b640b50bec12e817dc4b1e88681a58 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index ec7b5736152f12056a4336e4aff442004044de54..6ba1a5e211cdb0626c5d621a18df9e849650b225 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index 292c4f75daeac752b78c2ec642828692a43ff578..2ac89ffa7415610bec7d6858df693bfa84b0b284 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -14,7 +14,7 @@ ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index cbc20c9a3e79eafd107bbc1be5cc96f17e4b3cb1..6ab42eb077c4bb6a3f8a1f24210c76b63f64b7cd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -13,7 +13,7 @@ ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 3ba5242ed9225f1a6431ee6676a7b127f2f8d97e..c35101b960c52515abfef852ad1e3ef64e5ee357 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index bed3071a7cf6f0f83e101365c79556a96f9f3c65..69db1e525e8f4c10cfa97157f4b32ad4f61e5ba2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index 5f0b4f29d774769960c6924a7741306d5c371244..72f7345df0e83eab3c8927fd26ceed498fefd2b7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 2e059f8096dbc6a10b96881a0d01c620044a6e08..17a1ceac36123ce012266571dc271a5591327636 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -4,23 +4,26 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Append Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld ${status_code}= 400 +${invalid_fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld -*** Test Cases *** ENTITY_INVALID_ID -010_02_01_Append entity attributes if the entity Id is not present ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri +*** Test Cases *** +010_02_01_Append entity attributes if the entity Id is not present + Append Attributes ${EMPTY} +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri +010_02_03_Append entity attributes with invalid entity fragments + Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -31,4 +34,19 @@ Append Attributes Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Append entity attributes with invalid entity fragments + [Documentation] Check that you cannot append entity attributes with invalid entity fragments + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot deleted file mode 100644 index 864d9dbb3e56e5e3d9a6dd4b80380140767b9770..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot append entity attributes with invalid entity fragments -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Append entity attributes with invalid entity fragments - [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 155aa02c8662f0def4d23d7e946a986b33db7227..e84799b5292bdce9bcacd9d2efcf52c922b05d86 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index 58c836c2cfe3d36187900fb19a21d163299e33b4..f7bc5eef860ded47be6fa5a78aa212c044af9530 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -20,7 +20,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index 851ec9ca8b5115ef99351119d204d9607d47543a..2bcc4482711509e886b4dbc0867d18f137efe900 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -4,30 +4,46 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld -*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID -011_02_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} -011_02_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri +*** Test Cases *** +011_02_01_Update an attribute if the Entity Id is not present + Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_02_Update an attribute if the Entity Id is not a valid URI + Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_03_Update entity attributes with invalid entity fragments + Update entity attributes with invalid entity fragments vehicle-datasetid-attributes-sample.jsonld invalid-vehicle-fragment-datasetid-sample.jsonld *** Keywords *** Update Attributes - [Arguments] ${status_code} ${entity_invalid_id} + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Update entity attributes with invalid entity fragments + [Arguments] ${filename} ${fragment_filename} + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Output ${fragment_filename} + ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + #Check Response Status Code ${response} + #Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + #Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot deleted file mode 100644 index b64ac927a2077cf18739f9c6bd6528cd7cc02604..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update an attribute if the entity fragment is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Update entity attributes with invalid entity fragments - [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 6c37983391438e1a9748b8ea470f7f2f09579e10..442c727328c513493caf58deabec1cd831baf49c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -20,7 +20,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index e9e7405023cb93691c27b3d1fd17c10de2b2f492..9204ca029999429ee30cddc25954192dc106dac3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index e69df34a1cd138872df35ea1d8d40f15d9f8e4c6..078582435e5c91231c44a7c6b43dc2fffcf69472 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 9ce044b2f3cc62608413eabada45773784dc2de6..8b00f79797cb862e8dc6f843a4078a1ff4bde26c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} [Documentation] Check that you can delete an attribute from an entity - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot index be253f2f57616280b54bd8e25ebed85f1aa6b35e..5ee5aaa5fbc4ba9bd56168e209edf42a6b06548e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot index 7f527c1ee53b1236649539f5c06178ec507d808d..889e2450f721c73bf4b2c2dad8dc0ed9889eb23d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot deleted file mode 100644 index b0743d7f60053a28f6d10679b2ac9c0f087857ce..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: - -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_Create a temporal representation of an entity with simplified temporal representation of an Entity vehicle-simplified-temporal-representation-sample.jsonld application/json -001_02_Create a temporal representation of an entity with simple temporal properties vehicle-temporal-representation-sample.jsonld application/ld+json -001_03_Create an temporal entity with no context vehicle-temporal-representation-withou-context-sample.jsonld application/ld+json - -*** Keywords *** -Create Temporal Entity - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create a temporal representation of an entity - [Tags] mandatory - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} - Check Response Status Code 201 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..7c05ccbb95aa75b0d698f80208ffba1eb1fe147f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you can create a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity vehicle-temporal-representation-sample.jsonld application/ld+json +007_01_02_Create a temporal entity with no context vehicle-temporal-representation-without-context-sample.jsonld application/json + +*** Keywords *** +Create Temporal Entity + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + Check Response Status Code 201 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..15e943662c24230bc86a4f797d5ef1f64f1d063e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${status_code}= 400 + +*** Test Cases *** +007_02_01_Create a temporal entity with an invalid json + Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld + +007_02_02_Create a temporal entity with an empty json + Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld + +007_02_03_Create a temporal entity with missing id + Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld + +007_02_04_Create a temporal invalid URI + Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + +*** Keywords *** +Create Temporal Entity From File + [Arguments] ${filename} + [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id + [Tags] mandatory + + ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + +Create Temporal Entity + [Arguments] ${entity_id} ${filename} + [Documentation] Check that you cannot create a temporal entity with an invalid @context + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..68dd8cf822048da347f2103c4edbf1a348ad5089 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you can update a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld + +*** Test Cases *** +008_01_Update a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..2f87e8dd4d5c53fe3f7cc4dce36f86e4ef6a8ffa --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** +Delete a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Check Response Status Code 204 ${response['status']} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..4c713c74537b2e79542223d747617c585610f48b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE ID +009_02_01_Delete a temporal representation of an entity with an empty entity id 400 ${EMPTY} +009_02_02 Delete a temporal representation of an entity with an invalid entity id 400 invalidId + +*** Keywords *** +Delete Temporal Entity + [Arguments] ${status_code} ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Tags] mandatory + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..c3a1e0411645a2693512090e9cb8ab7674ba7bf0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 + +*** Test Cases *** +009_03 Delete a temporal representation of an entity with a unknown entity id + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..e30995ff62062dd27220c176da2bcd2efc715def --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld + +*** Test Cases *** +014_01_02_Add an attribute to a temporal entity with simple temporal properties + [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..7eb7acc9038c0d338389ad20e189bab08be7585a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 400 + +*** Test Cases *** +014_02_01_Add an attribute to a temporal representation of an entity with invalid content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld + +014_02_02_Add an attribute to a temporal representation of an entity with empty content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld + +014_02_03_Add an attribute to a temporal representation of an entity with an empty entity id + Fail To Add Attribute To Temporal Entity ${EMPTY} + +014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id + Fail To Add Attribute To Temporal Entity thisIsAninvalidId + +*** Keywords *** +Add an Attribute To a Temporal Entity + [Arguments] ${update_filename} + [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Fail To Add Attribute To Temporal Entity + [Arguments] ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..1ca7648a5502870256a611af8ac1cd65e7dc963a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with not found EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 404 + +*** Test Cases *** +Add Attribute To Temporal Entity + [Documentation] Check that an error is raised if you delete a temporal enitity with not found EnityId EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..aeb72a1b35744f2781e719e9d44beed3166c50d2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attribute From A Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel + +*** Test Cases *** DELETEALL DATASETID +015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel +015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel + +*** Keywords *** +Delete Attribute From A Temporal Entity + [Arguments] ${deleteAll} ${datasetId} + [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..f6ca104a4bcb69ff647ac19fbd76e031c725ff30 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute from temporal entity with unknow entity/attribute id + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId +015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalidName + +*** Keywords *** +Delete attribute from temporal entity with unknow entity/attribute id + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..7623acb47f464c1043ba35393be8b1ea7e3e83cc --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist ${unknown_temporal_entity_id} fuelLevel +015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute ${valid_temporal_entity_id} notExistingAttribute + +*** Keywords *** +Delete Attribute + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} + Set Suite Variable ${unknown_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..a27641f8f3f1716b7873d8b870ac2e4133275a80 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can partially update an attribute instance of a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +016_01_Partially update an attribute instance of a temporal representation of an entity + [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + Should Be Equal As Strings ${createdAt_before_update} ${modifiedAt_before_update} + Should Be Equal As Strings ${createdAt_before_update} ${createdAt_after_update} + ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch + ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch + Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..99d5d0f78dc45353ea0715e69205190b284828b6 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..60debbb9a711de48cf4c993544d8e9bb960b1b21 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..b6b727c83763f8d2c4b7123ee418e2c8dc0449c7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you can delete an attribute instance in temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +017_01_Delete an attribute instance in temporal representation of an entity + [Documentation] Check that you can delete an attribute instance in temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..c98188766dc1c5ad492ae8bebd51460be20c475a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute instance + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Delete attribute instance + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..e0cbd05b62e068f10e9b699ecaeb0b0faf3a5bce --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index bd9a79fff672fd4699eb8cf03323fb8a574dd974..29742ccaf6bc237b98ada90a38573bc4f6a6b0d0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -4,15 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Context Source With Invalid Content - - *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Cases *** FILENAME -033_02_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld -033_02_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld +*** Test Cases *** +033_02_01_Create a context source registration with invalid JSON file + Create a context source registration with invalid JSON file +033_02_02_Create a context source registration with a different data structure than CsourRegistration data type + Create Context Source With Invalid Content csourceRegistrations/registration-invalid-structure-sample.jsonld +033_02_03_Create a context source registration with a date in the past + Create Context Source With Invalid Content csourceRegistrations/registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content @@ -28,3 +30,15 @@ Create Context Source With Invalid Content Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} [Teardown] Delete Context Source Registration ${registration_id} + +Create a context source registration with invalid JSON file + [Documentation] Create a context source registration with invalid JSON file + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot deleted file mode 100644 index b89f36b0699b4e5260c817da8c27be80b903bb5b..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot +++ /dev/null @@ -1,22 +0,0 @@ -*** Settings *** -Documentation Create a context source registration with invalid JSON file -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Cases *** -Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 1068f5b2d92377e23f4600cd9b857553b30a887c..08e3a176ce4dbfd36cb2999fed51d28c4e65eb09 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -5,17 +5,23 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities -Test Template Update Context Source *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Case *** REGISTRATION_ID FRAGMENT_FILENAME -034_02_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld -034_02_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld -034_02_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld -034_02_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld +*** Test Case *** +034_02_01_Update a context source registration by id if the Id is not present + Update Context Source ${EMPTY} registration-with-expiration-sample.jsonld +034_02_02_Update a context source registration by id if the Id is not a valid URI + Update Context Source invalidURI registration-with-expiration-sample.jsonld +034_02_03_Update a context source registration if the request body is not of the same data type + Update Context Source ${valid_registration_id} registration-different-type-sample.jsonld +034_02_04_Update a context source registration if you attempt to remove a mandatory property + Update Context Source ${valid_registration_id} registration-invalid-structure-sample.jsonld +034_02_05_Update a context source registration if the request body is invalid + Update a context source registration if the request body is invalid *** Keywords *** Update Context Source @@ -35,6 +41,23 @@ Update Context Source [Teardown] Delete Context Source Registration ${valid_registration_id} +Update a context source registration if the request body is invalid + [Documentation] Check that you cannot update a context source registration if the request body is invalid + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Context Source Registration ${registration_id} + + Setup Initial Entities ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${valid_registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot deleted file mode 100644 index 0d986b93419cd5fdfd7bf0c3f19edf6a4f8bd344..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update a context source registration if the request body is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Case *** -Update a context source registration if the request body is invalid - [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..332addc2011dd28e62f20e8e41d2cd8756e8a655 --- /dev/null +++ b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld @@ -0,0 +1,18 @@ + + { + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://uri.fiware.org/ns/data-models#Building", + "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3eb294f50c5e0eefa486ebda4370ec5fd2e6cc9f 100644 --- a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld +++ b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld @@ -0,0 +1,60 @@ +[ + { + "id": "urn:ngsi-ld:OffStreetParking:1149507078845158", + "type": "https://uri.fiware.org/ns/data-models#OffStreetParking", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.5, + 41.2 + ] + } + }, + "name": { + "type": "Property", + "value": "Downtown One" + }, + "https://uri.fiware.org/ns/data-models#availableSpotNumber": { + "type": "Property", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + }, + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "https://uri.fiware.org/ns/data-models#reliability": { + "type": "Property", + "value": 0.7 + } + }, + "https://uri.fiware.org/ns/data-models#totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + { + "id": "urn:ngsi-ld:Vehicle:8601152883544931", + "type": "https://uri.fiware.org/ns/data-models#Vehicle", + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "https://uri.fiware.org/ns/data-models#brandName": { + "type": "Property", + "value": "Mercedes" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..28242dc796cdb455efb09db60eac8ce1d5eeaa5b --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,14 @@ +{ + "added_attribute": { + "type": "Property", + "values": [ + [121,"2018-08-01T12:03:00Z"], + [80,"2018-08-01T12:05:00Z"], + [100,"2018-08-01T12:07:00Z"] + ] + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..60e19dde1f3c5d4d921a60569611ec77d3d4f0ce --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld @@ -0,0 +1,12 @@ +{ + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..985d962a8708cf1089ce1b14313aa8780c710322 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,22 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..95b7174fb8ed253e2ed0488d79746743b8874623 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..922b0d312162fe04d89350aeb837e3201dbc0f0f --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld @@ -0,0 +1,19 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..9f8f2dd83bbeb5d68e11e05a177dded31c7f4aaa --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "invalidcontext" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..95b7174fb8ed253e2ed0488d79746743b8874623 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 65c4053a47a75c231669ff4e76fa996d28aba800..2dde1c15c62216b7e183b7993c8f15fc99c15df6 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -38,7 +38,8 @@ { "type":"Property", "value":40, - "observedAt":"2020-09-01T14:07:00Z" + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" } ], "@context":[ diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..67e5725742e1b50ec25cbf0ec87982caad129f92 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":121, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld similarity index 100% rename from data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld rename to data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld diff --git a/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..e803e2f9d3eab074d9829745c943c3c10db5cfd4 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 7a31f5543fc85bfa156e6abbdc33236994e4f691..342cca12099c9a144ef012be0fc31025a2a904d8 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -143,7 +143,7 @@ Append Entity Attributes Using Session [return] ${response} Update Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} @@ -161,7 +161,7 @@ Update Entity Attributes [return] ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} Output request Output response @@ -256,7 +256,7 @@ Update Context Source Registration Using Session Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any - ${request}= Output request + Output request Output response [return] ${response} @@ -276,13 +276,83 @@ Create Entity Output request Output response -Create Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} +Create Or Update Temporal Representation Of Entity Selecting Content Type + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} + Output request + Output response + [return] ${response} +Create Temporal Representation Of Entity Selecting Content Type Using Session + [Arguments] ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} + Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity Using Session + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + Create Session OneRequest ${url} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Partial Update Attribute From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Attribute From Temporal Entity + [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Temporal Representation Of Entity With Returning Response + [Arguments] ${temporal_entity_representation_id} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response + [return] ${response} + +Get Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} ${content_type} ${options}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + &{params}= Create Dictionary + ${options_length} = Get Length ${options} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + +Delete Attribute Instance From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} Output request Output response [return] ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index cda0beb8879979b3ea239703fbb9ce009edf61a2..60545bf1faa8975d078b10a887c8990e92a57b60 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -98,6 +98,19 @@ Check Response Body Containing List Containing Entity Elements ${index}= Evaluate ${index} + 1 END +Check Response Body Containing List Containing Entity Elements With Different Types + [Arguments] ${filename} ${entities_representation_ids} ${response_body} + ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} + ${index}= Set Variable 1 + FOR ${entity_representation_id} IN @{entities_representation_ids} + ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} + ${index}= Evaluate ${index} - 1 + END + Log ${response_body} + Log ${entities_representation_payload} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=Entity List Comparaison Failed + Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename}