From 1a620d5664908a660861d88e393301b28ab81932 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 23 Feb 2021 15:50:23 +0000 Subject: [PATCH] added entity attributes and fixed bugs --- .../Consumption/Entity/018_02.robot | 2 +- .../Consumption/Entity/018_03_01.robot | 2 +- .../Consumption/Entity/018_03_02.robot | 2 +- .../Consumption/Entity/018_04.robot | 2 +- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 8 +- .../Consumption/Entity/019_01_02.robot | 9 +- .../Consumption/Entity/019_01_03.robot | 6 +- .../Consumption/Entity/019_01_04.robot | 13 +-- .../Consumption/Entity/019_01_05.robot | 6 +- .../Consumption/Entity/019_02_01.robot | 2 +- .../Consumption/Entity/019_02_02.robot | 2 +- .../Consumption/Entity/019_02_03.robot | 2 +- .../Consumption/Entity/019_02_04.robot | 2 +- .../Consumption/Entity/019_02_05.robot | 2 +- .../Consumption/Entity/019_03_01.robot | 2 +- .../Consumption/Entity/019_03_02.robot | 2 +- .../Consumption/Entity/019_03_03.robot | 2 +- .../Consumption/Entity/019_03_04.robot | 2 +- .../Consumption/Entity/019_03_05.robot | 2 +- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- .../Consumption/Entity/019_06.robot | 2 +- .../Provision/EntityAttributes/010_02.robot | 30 +++++-- .../EntityAttributes/010_02_03.robot | 26 ------ .../Provision/EntityAttributes/010_03.robot | 2 +- .../Provision/EntityAttributes/011_01.robot | 2 +- .../Provision/EntityAttributes/011_02.robot | 36 +++++--- .../EntityAttributes/011_02_03.robot | 26 ------ .../{011_04.robot => 011_03.robot} | 0 .../Provision/EntityAttributes/012_01.robot | 2 +- .../Provision/EntityAttributes/012_02.robot | 2 +- .../Provision/EntityAttributes/012_03.robot | 2 +- .../Provision/EntityAttributes/013_01.robot | 2 +- .../Provision/EntityAttributes/013_02.robot | 2 +- .../Provision/EntityAttributes/013_03.robot | 2 +- .../Provision/TemporalEntity/001.robot | 27 ------ .../Provision/TemporalEntity/007_01.robot | 26 ++++++ .../Provision/TemporalEntity/007_02.robot | 42 ++++++++++ .../Provision/TemporalEntity/008_01.robot | 25 ++++++ .../Provision/TemporalEntity/009_01.robot | 21 +++++ .../Provision/TemporalEntity/009_02.robot | 25 ++++++ .../Provision/TemporalEntity/009_03.robot | 21 +++++ .../Provision/TemporalEntity/014_01.robot | 24 ++++++ .../Provision/TemporalEntity/014_02.robot | 53 ++++++++++++ .../Provision/TemporalEntity/014_03.robot | 26 ++++++ .../Provision/TemporalEntity/015_01.robot | 33 ++++++++ .../Provision/TemporalEntity/015_02.robot | 40 +++++++++ .../Provision/TemporalEntity/015_03.robot | 39 +++++++++ .../Provision/TemporalEntity/016_01.robot | 40 +++++++++ .../Provision/TemporalEntity/016_02.robot | 43 ++++++++++ .../Provision/TemporalEntity/016_03.robot | 42 ++++++++++ .../Provision/TemporalEntity/017_01.robot | 28 +++++++ .../Provision/TemporalEntity/017_02.robot | 42 ++++++++++ .../Provision/TemporalEntity/017_03.robot | 41 ++++++++++ .../033_02.robot | 26 ++++-- .../033_02_01.robot | 22 ----- .../034_02.robot | 35 ++++++-- .../034_02_05.robot | 27 ------ ...attributes-query-sample-expectation.jsonld | 18 ++++ .../vehicle-parking-sample-expectation.jsonld | 60 ++++++++++++++ ...oral-representation-fragment-sample.jsonld | 14 ++++ ...le-temporal-intanceid-update-sample.jsonld | 12 +++ ...-representation-empty-json-fragment.jsonld | 0 ...oral-representation-fragment-sample.jsonld | 22 +++++ ...epresentation-invalid-json-fragment.jsonld | 47 +++++++++++ ...ion-without-context-fragment-sample.jsonld | 19 +++++ ...cle-temporal-invalid-context-sample.jsonld | 47 +++++++++++ ...al-representation-empty-json-sample.jsonld | 0 ...-representation-invalid-json-sample.jsonld | 47 +++++++++++ ...icle-temporal-representation-sample.jsonld | 4 +- ...mporal-representation-update-sample.jsonld | 47 +++++++++++ ...resentation-without-context-sample.jsonld} | 0 ...al-representation-without-id-sample.jsonld | 48 +++++++++++ resources/ApiUtils.resource | 82 +++++++++++++++++-- resources/AssertionUtils.resource | 15 ++++ 76 files changed, 1233 insertions(+), 209 deletions(-) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{011_04.robot => 011_03.robot} (100%) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot delete mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot delete mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot create mode 100644 data/entities/expectations/building-attributes-query-sample-expectation.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld rename data/temporalEntities/{vehicle-temporal-representation-withou-context-sample.jsonld => vehicle-temporal-representation-without-context-sample.jsonld} (100%) create mode 100644 data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index f91428d6..548f50ed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] mandatory failing + [Tags] mandatory ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 3349a57a..5bad223c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 164e4581..534477a0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an atris not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index ce5a82b2..366e2126 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index 8ee32f94..d7e60109 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 075a6e08..8811972f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -25,11 +25,13 @@ Query several entities based on ids ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index a32ec395..4c93e4cc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -32,11 +32,12 @@ Query several entities based on the entities types ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + #@{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} + Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index f97279c1..859d1364 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -23,11 +23,11 @@ Query several entities based on the given id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} + @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index afb3db77..acde9947 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -6,8 +6,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @@ -15,17 +16,17 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index 07cfb0ff..e50cd66c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -6,15 +6,15 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 6d6f8cb1..cc5212af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index c9717c56..48f23f49 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 32e200c0..d165add1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 82b7a91e..8c185147 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -15,7 +15,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 79e1ce2c..e9428400 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index f1f322cb..2498e50b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index fbe5ef33..79fb8608 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 87739e2b..8f1764d6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index bceffdaf..f2a2da7b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -14,7 +14,7 @@ ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index a89e2924..3a578342 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -13,7 +13,7 @@ ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 4deb4252..4a3f8ff1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 6c07b580..6e7d5a01 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index d9659dd3..f705469d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 2e059f80..17a1ceac 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -4,23 +4,26 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Append Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld ${status_code}= 400 +${invalid_fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld -*** Test Cases *** ENTITY_INVALID_ID -010_02_01_Append entity attributes if the entity Id is not present ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri +*** Test Cases *** +010_02_01_Append entity attributes if the entity Id is not present + Append Attributes ${EMPTY} +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri +010_02_03_Append entity attributes with invalid entity fragments + Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -31,4 +34,19 @@ Append Attributes Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Append entity attributes with invalid entity fragments + [Documentation] Check that you cannot append entity attributes with invalid entity fragments + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot deleted file mode 100644 index 864d9dbb..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot append entity attributes with invalid entity fragments -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Append entity attributes with invalid entity fragments - [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 155aa02c..e84799b5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index 58c836c2..f7bc5eef 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -20,7 +20,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index 851ec9ca..2bcc4482 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -4,30 +4,46 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld -*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID -011_02_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} -011_02_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri +*** Test Cases *** +011_02_01_Update an attribute if the Entity Id is not present + Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_02_Update an attribute if the Entity Id is not a valid URI + Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_03_Update entity attributes with invalid entity fragments + Update entity attributes with invalid entity fragments vehicle-datasetid-attributes-sample.jsonld invalid-vehicle-fragment-datasetid-sample.jsonld *** Keywords *** Update Attributes - [Arguments] ${status_code} ${entity_invalid_id} + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Update entity attributes with invalid entity fragments + [Arguments] ${filename} ${fragment_filename} + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Output ${fragment_filename} + ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + #Check Response Status Code ${response} + #Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + #Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot deleted file mode 100644 index b64ac927..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update an attribute if the entity fragment is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Update entity attributes with invalid entity fragments - [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 6c379833..442c7273 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -20,7 +20,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index e9e74050..9204ca02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index e69df34a..07858243 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 9ce044b2..8b00f797 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} [Documentation] Check that you can delete an attribute from an entity - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot index be253f2f..5ee5aaa5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot index 7f527c1e..889e2450 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot deleted file mode 100644 index b0743d7f..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: - -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_Create a temporal representation of an entity with simplified temporal representation of an Entity vehicle-simplified-temporal-representation-sample.jsonld application/json -001_02_Create a temporal representation of an entity with simple temporal properties vehicle-temporal-representation-sample.jsonld application/ld+json -001_03_Create an temporal entity with no context vehicle-temporal-representation-withou-context-sample.jsonld application/ld+json - -*** Keywords *** -Create Temporal Entity - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create a temporal representation of an entity - [Tags] mandatory - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} - Check Response Status Code 201 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot new file mode 100644 index 00000000..7c05ccbb --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you can create a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity vehicle-temporal-representation-sample.jsonld application/ld+json +007_01_02_Create a temporal entity with no context vehicle-temporal-representation-without-context-sample.jsonld application/json + +*** Keywords *** +Create Temporal Entity + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + Check Response Status Code 201 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot new file mode 100644 index 00000000..15e94366 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${status_code}= 400 + +*** Test Cases *** +007_02_01_Create a temporal entity with an invalid json + Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld + +007_02_02_Create a temporal entity with an empty json + Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld + +007_02_03_Create a temporal entity with missing id + Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld + +007_02_04_Create a temporal invalid URI + Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + +*** Keywords *** +Create Temporal Entity From File + [Arguments] ${filename} + [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id + [Tags] mandatory + + ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + +Create Temporal Entity + [Arguments] ${entity_id} ${filename} + [Documentation] Check that you cannot create a temporal entity with an invalid @context + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot new file mode 100644 index 00000000..68dd8cf8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you can update a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld + +*** Test Cases *** +008_01_Update a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot new file mode 100644 index 00000000..2f87e8dd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** +Delete a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Check Response Status Code 204 ${response['status']} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot new file mode 100644 index 00000000..4c713c74 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE ID +009_02_01_Delete a temporal representation of an entity with an empty entity id 400 ${EMPTY} +009_02_02 Delete a temporal representation of an entity with an invalid entity id 400 invalidId + +*** Keywords *** +Delete Temporal Entity + [Arguments] ${status_code} ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Tags] mandatory + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot new file mode 100644 index 00000000..c3a1e041 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 + +*** Test Cases *** +009_03 Delete a temporal representation of an entity with a unknown entity id + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot new file mode 100644 index 00000000..e30995ff --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld + +*** Test Cases *** +014_01_02_Add an attribute to a temporal entity with simple temporal properties + [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot new file mode 100644 index 00000000..7eb7acc9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 400 + +*** Test Cases *** +014_02_01_Add an attribute to a temporal representation of an entity with invalid content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld + +014_02_02_Add an attribute to a temporal representation of an entity with empty content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld + +014_02_03_Add an attribute to a temporal representation of an entity with an empty entity id + Fail To Add Attribute To Temporal Entity ${EMPTY} + +014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id + Fail To Add Attribute To Temporal Entity thisIsAninvalidId + +*** Keywords *** +Add an Attribute To a Temporal Entity + [Arguments] ${update_filename} + [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Fail To Add Attribute To Temporal Entity + [Arguments] ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot new file mode 100644 index 00000000..1ca7648a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with not found EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 404 + +*** Test Cases *** +Add Attribute To Temporal Entity + [Documentation] Check that an error is raised if you delete a temporal enitity with not found EnityId EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot new file mode 100644 index 00000000..aeb72a1b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attribute From A Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel + +*** Test Cases *** DELETEALL DATASETID +015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel +015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel + +*** Keywords *** +Delete Attribute From A Temporal Entity + [Arguments] ${deleteAll} ${datasetId} + [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot new file mode 100644 index 00000000..f6ca104a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute from temporal entity with unknow entity/attribute id + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId +015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalidName + +*** Keywords *** +Delete attribute from temporal entity with unknow entity/attribute id + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot new file mode 100644 index 00000000..7623acb4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist ${unknown_temporal_entity_id} fuelLevel +015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute ${valid_temporal_entity_id} notExistingAttribute + +*** Keywords *** +Delete Attribute + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} + Set Suite Variable ${unknown_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot new file mode 100644 index 00000000..a27641f8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can partially update an attribute instance of a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +016_01_Partially update an attribute instance of a temporal representation of an entity + [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + Should Be Equal As Strings ${createdAt_before_update} ${modifiedAt_before_update} + Should Be Equal As Strings ${createdAt_before_update} ${createdAt_after_update} + ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch + ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch + Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot new file mode 100644 index 00000000..99d5d0f7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot new file mode 100644 index 00000000..60debbb9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot new file mode 100644 index 00000000..b6b727c8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you can delete an attribute instance in temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +017_01_Delete an attribute instance in temporal representation of an entity + [Documentation] Check that you can delete an attribute instance in temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot new file mode 100644 index 00000000..c9818876 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute instance + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Delete attribute instance + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot new file mode 100644 index 00000000..e0cbd05b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index bd9a79ff..29742cca 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -4,15 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Context Source With Invalid Content - - *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Cases *** FILENAME -033_02_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld -033_02_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld +*** Test Cases *** +033_02_01_Create a context source registration with invalid JSON file + Create a context source registration with invalid JSON file +033_02_02_Create a context source registration with a different data structure than CsourRegistration data type + Create Context Source With Invalid Content csourceRegistrations/registration-invalid-structure-sample.jsonld +033_02_03_Create a context source registration with a date in the past + Create Context Source With Invalid Content csourceRegistrations/registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content @@ -28,3 +30,15 @@ Create Context Source With Invalid Content Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} [Teardown] Delete Context Source Registration ${registration_id} + +Create a context source registration with invalid JSON file + [Documentation] Create a context source registration with invalid JSON file + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot deleted file mode 100644 index b89f36b0..00000000 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot +++ /dev/null @@ -1,22 +0,0 @@ -*** Settings *** -Documentation Create a context source registration with invalid JSON file -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Cases *** -Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 1068f5b2..08e3a176 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -5,17 +5,23 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities -Test Template Update Context Source *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Case *** REGISTRATION_ID FRAGMENT_FILENAME -034_02_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld -034_02_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld -034_02_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld -034_02_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld +*** Test Case *** +034_02_01_Update a context source registration by id if the Id is not present + Update Context Source ${EMPTY} registration-with-expiration-sample.jsonld +034_02_02_Update a context source registration by id if the Id is not a valid URI + Update Context Source invalidURI registration-with-expiration-sample.jsonld +034_02_03_Update a context source registration if the request body is not of the same data type + Update Context Source ${valid_registration_id} registration-different-type-sample.jsonld +034_02_04_Update a context source registration if you attempt to remove a mandatory property + Update Context Source ${valid_registration_id} registration-invalid-structure-sample.jsonld +034_02_05_Update a context source registration if the request body is invalid + Update a context source registration if the request body is invalid *** Keywords *** Update Context Source @@ -35,6 +41,23 @@ Update Context Source [Teardown] Delete Context Source Registration ${valid_registration_id} +Update a context source registration if the request body is invalid + [Documentation] Check that you cannot update a context source registration if the request body is invalid + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Context Source Registration ${registration_id} + + Setup Initial Entities ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${valid_registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot deleted file mode 100644 index 0d986b93..00000000 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update a context source registration if the request body is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Case *** -Update a context source registration if the request body is invalid - [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld new file mode 100644 index 00000000..332addc2 --- /dev/null +++ b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld @@ -0,0 +1,18 @@ + + { + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://uri.fiware.org/ns/data-models#Building", + "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld index e69de29b..3eb294f5 100644 --- a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld +++ b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld @@ -0,0 +1,60 @@ +[ + { + "id": "urn:ngsi-ld:OffStreetParking:1149507078845158", + "type": "https://uri.fiware.org/ns/data-models#OffStreetParking", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.5, + 41.2 + ] + } + }, + "name": { + "type": "Property", + "value": "Downtown One" + }, + "https://uri.fiware.org/ns/data-models#availableSpotNumber": { + "type": "Property", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + }, + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "https://uri.fiware.org/ns/data-models#reliability": { + "type": "Property", + "value": 0.7 + } + }, + "https://uri.fiware.org/ns/data-models#totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + { + "id": "urn:ngsi-ld:Vehicle:8601152883544931", + "type": "https://uri.fiware.org/ns/data-models#Vehicle", + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "https://uri.fiware.org/ns/data-models#brandName": { + "type": "Property", + "value": "Mercedes" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld new file mode 100644 index 00000000..28242dc7 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,14 @@ +{ + "added_attribute": { + "type": "Property", + "values": [ + [121,"2018-08-01T12:03:00Z"], + [80,"2018-08-01T12:05:00Z"], + [100,"2018-08-01T12:07:00Z"] + ] + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld new file mode 100644 index 00000000..60e19dde --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld @@ -0,0 +1,12 @@ +{ + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld new file mode 100644 index 00000000..985d962a --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,22 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld new file mode 100644 index 00000000..95b7174f --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld new file mode 100644 index 00000000..922b0d31 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld @@ -0,0 +1,19 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld new file mode 100644 index 00000000..9f8f2dd8 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "invalidcontext" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld new file mode 100644 index 00000000..95b7174f --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 4f095bf1..47075f58 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -38,11 +38,11 @@ { "type":"Property", "value":40, - "observedAt":"2020-09-01T14:07:00Z" + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld new file mode 100644 index 00000000..67e57257 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":121, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld similarity index 100% rename from data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld rename to data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld diff --git a/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld new file mode 100644 index 00000000..e803e2f9 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ca87fce1..22b11db6 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -140,7 +140,7 @@ Append Entity Attributes Using Session [return] ${response} Update Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} @@ -158,7 +158,7 @@ Update Entity Attributes [return] ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} Output request Output response @@ -204,7 +204,7 @@ Update Context Source Registration Using Session Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any - ${request}= Output request + Output request Output response [return] ${response} @@ -224,13 +224,83 @@ Create Entity Output request Output response -Create Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} +Create Or Update Temporal Representation Of Entity Selecting Content Type + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} + Output request + Output response + [return] ${response} +Create Temporal Representation Of Entity Selecting Content Type Using Session + [Arguments] ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} + Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity Using Session + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + Create Session OneRequest ${url} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Partial Update Attribute From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Attribute From Temporal Entity + [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Temporal Representation Of Entity With Returning Response + [Arguments] ${temporal_entity_representation_id} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response + [return] ${response} + +Get Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} ${content_type} ${options}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + &{params}= Create Dictionary + ${options_length} = Get Length ${options} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + +Delete Attribute Instance From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} Output request Output response [return] ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 415a2d02..4381f713 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -75,6 +75,8 @@ Check Response Body Containing Entity element [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + Log ${entity} + Log ${response_body} ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=Entity Comparaison Failed @@ -86,6 +88,19 @@ Check Response Body Containing List Containing Entity Elements ${index}= Evaluate ${index} + 1 END +Check Response Body Containing List Containing Entity Elements With Different Types + [Arguments] ${filename} ${entities_representation_ids} ${response_body} + ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} + ${index}= Set Variable 1 + FOR ${entity_representation_id} IN @{entities_representation_ids} + ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} + ${index}= Evaluate ${index} - 1 + END + Log ${response_body} + Log ${entities_representation_payload} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=Entity List Comparaison Failed + Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} -- GitLab