From ad03e58d7fc4ee0f24a4d62ca6ff330a45450085 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 18 Jul 2024 16:43:56 +0200 Subject: [PATCH] feat: add permutation for attrs params in Temporal API --- .../020_03.robot | 23 +++++++---- ...-temporal-representation-020-03-01.jsonld} | 0 ...e-temporal-representation-020-03-02.jsonld | 38 +++++++++++++++++++ 3 files changed, 53 insertions(+), 8 deletions(-) rename data/temporalEntities/expectations/{vehicle-temporal-representation-020-03-expectation.jsonld => vehicle-temporal-representation-020-03-01.jsonld} (100%) create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-03-02.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 8c75629c..8ecbe3f2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Create Temporal Entity Test Teardown Delete Initial Temporal Entity +Test Template Retrieve the temporal evolution of certain attributes of an entity *** Variables *** @@ -16,23 +17,29 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample. ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld -*** Test Cases *** -020_03_01 Retrieve the temporal evolution of certain attributes of an entity - [Documentation] Check that one can retrieve the temporal evolution of certain attributes of an entity +*** Test Cases *** ATTRS EXPECTED_RESULT +020_03_01 With one attribute + [Tags] te-retrieve 5_7_3 + fuelLevel vehicle-temporal-representation-020-03-01.jsonld +020_03_02 With two attributes [Tags] te-retrieve 5_7_3 - @{temporal_attributes_to_be_retrieved}= Create List fuelLevel + fuelLevel,speed vehicle-temporal-representation-020-03-02.jsonld + + +*** Keywords *** +Retrieve the temporal evolution of certain attributes of an entity + [Documentation] Check that one can retrieve the temporal evolution of certain attributes of an entity + [Arguments] ${attrs} ${expected_result} ${response}= Retrieve Temporal Representation Of Entity ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... attrs=${temporal_attributes_to_be_retrieved} + ... attrs=${attrs} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element - ... ${vehicle_expectation_file} + ... ${expected_result} ... ${temporal_entity_representation_id} ... ${response.json()} - -*** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-01.jsonld similarity index 100% rename from data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld rename to data/temporalEntities/expectations/vehicle-temporal-representation-020-03-01.jsonld diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-02.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-02.jsonld new file mode 100644 index 00000000..a92f1c95 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-02.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "fuelLevel": [ + { + "type": "Property", + "value": 67, + "observedAt": "2020-08-01T12:03:00Z" + }, + { + "type": "Property", + "value": 53, + "observedAt": "2020-08-01T13:05:00Z" + }, + { + "type": "Property", + "value": 40, + "observedAt": "2020-08-01T14:07:00Z" + } + ], + "speed": [ + { + "type": "Property", + "value": 120, + "observedAt": "2020-08-01T12:03:00Z" + }, + { + "type": "Property", + "value": 80, + "observedAt": "2020-08-01T12:05:00Z" + }, + { + "type": "Property", + "value": 100, + "observedAt": "2020-08-01T12:07:00Z" + } + ] +} \ No newline at end of file -- GitLab