From 6ac47f64df0008ad13eb102d00e58bb363752b5d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 5 Nov 2024 18:26:54 +0100 Subject: [PATCH 1/3] feat: add TCs for POST queries with multiple entities selectors --- .../Entity/QueryEntities/019_02_01.robot | 5 +- .../Entity/QueryEntities/019_02_02.robot | 4 +- .../Entity/QueryEntities/019_02_03.robot | 5 +- .../Entity/QueryEntities/019_02_05.robot | 4 +- .../Entity/QueryEntities/019_02_06.robot | 64 +++++++++++++++++++ .../021_13.robot | 19 +++++- ...operations-after-query-two-entities.jsonld | 15 +++++ ...s-temporal-representation-021-13-04.jsonld | 58 +++++++++++++++++ .../ContextInformationConsumption.resource | 17 +---- 9 files changed, 167 insertions(+), 24 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_06.robot create mode 100644 data/temporalEntities/entity-operations-after-query-two-entities.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-bus-temporal-representation-021-13-04.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index 254620a4..b71cfdd8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -22,9 +22,10 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Documentation] Check that one can query one entity via POST Interaction based on id [Tags] e-query 5_7_2 @{entities_ids_to_be_compared}= Create List ${first_entity_id} + ${entity_selector}= Create Dictionary id=${first_entity_id} type=${entity_type} + @{entities}= Create List ${entity_selector} ${response}= Query Entities Via POST - ... entity_id=${first_entity_id} - ... entity_type=${entity_type} + ... entities=${entities} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index 488a4200..49bfe69c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -25,8 +25,10 @@ ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle [Documentation] Check that one can query several entities via POST Interaction based on the entity type [Tags] e-query 5_7_2 ${entities_ids_to_be_compared}= Create List ${first_vehicle_entity_id} ${second_vehicle_entity_id} + ${entity_selector}= Create Dictionary type=${vehicle_entity_type} + @{entities}= Create List ${entity_selector} ${response}= Query Entities Via POST - ... entity_type=${vehicle_entity_type} + ... entities=${entities} ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements With Different Types diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 7dd7b463..56d9f014 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -23,9 +23,10 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* [Documentation] Check that one can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entity_selector}= Create Dictionary idPattern=${entity_id_pattern} type=${entity_type} + @{entities}= Create List ${entity_selector} ${response}= Query Entities Via POST - ... entity_id_pattern=${entity_id_pattern} - ... entity_type=${entity_type} + ... entities=${entities} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index ad2e11a3..edc5b38d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -25,8 +25,10 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking [Documentation] Check that one can query entities via POST Interaction asking for a GeoJSON representation [Tags] e-query 5_7_2 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} + ${entity_selector}= Create Dictionary type=${entity_types_to_be_retrieved} + @{entities}= Create List ${entity_selector} ${response}= Query Entities Via POST - ... entity_type=${entity_types_to_be_retrieved} + ... entities=${entities} ... accept=${CONTENT_TYPE_GEOJSON} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_06.robot new file mode 100644 index 00000000..0f02f838 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_06.robot @@ -0,0 +1,64 @@ +*** Settings *** +Documentation Check that one can query two entities via POST Interaction based on ids + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Entities +Suite Teardown Delete Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal.jsonld +${expectation_filename}= building-minimal.json +${entity_type}= https://ngsi-ld-test-suite/context#Building + + +*** Test Cases *** +019_02_06 Query two entities via POST Interaction based on ids + [Documentation] Check that one can query two entities via POST Interaction based on ids + [Tags] e-query 5_7_2 + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${first_entity_selector}= Create Dictionary id=${first_entity_id} type=${entity_type} + ${second_entity_selector}= Create Dictionary id=${second_entity_id} type=${entity_type} + @{entities}= Create List ${first_entity_selector} ${second_entity_selector} + ${response}= Query Entities Via POST + ... entities=${entities} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing Entity Elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response.json()} + + +*** Keywords *** +Create Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by Id ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 51162102..cf148abf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -13,20 +13,25 @@ Test Template Query the temporal evolution of entities using the entityOpe *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: ${first_vehicle_payload_file}= 2020-08-vehicle-temporal-representation.jsonld ${second_vehicle_payload_file}= 2020-09-vehicle-temporal-representation.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation.jsonld *** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE -021_13_01 After +021_13_01 After One Entity [Tags] te-query 5_7_4 entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01.jsonld -021_13_02 Before +021_13_02 Before One Entity [Tags] te-query 5_7_4 entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02.jsonld -021_13_03 Between +021_13_03 Between One Entity [Tags] te-query 5_7_4 entity-operations-between-query.jsonld vehicles-temporal-representation-021-13-03.jsonld +021_13_04 After Two Entities + [Tags] te-query 5_7_4 + entity-operations-after-query-two-entities.jsonld vehicles-bus-temporal-representation-021-13-04.jsonld *** Keywords *** @@ -39,6 +44,7 @@ Query the temporal evolution of entities using the entityOperations method @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} + ... ${third_temporal_entity_representation_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} @@ -58,7 +64,14 @@ Setup Initial Temporal Entities ... ${second_temporal_entity_representation_id} Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_temporal_entity_representation_id} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + ${create_response3}= Create Temporal Representation Of Entity + ... ${bus_payload_file} + ... ${third_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response3.status_code} + Set Test Variable ${third_temporal_entity_representation_id} Delete Initial Temporal Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/data/temporalEntities/entity-operations-after-query-two-entities.jsonld b/data/temporalEntities/entity-operations-after-query-two-entities.jsonld new file mode 100644 index 00000000..2e03c5a8 --- /dev/null +++ b/data/temporalEntities/entity-operations-after-query-two-entities.jsonld @@ -0,0 +1,15 @@ +{ + "type": "Query", + "entities": [ + { + "type": "Vehicle" + }, + { + "type": "Bus" + } + ], + "temporalQ": { + "timerel": "after", + "timeAt": "2020-08-02T12:05:00Z" + } +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-bus-temporal-representation-021-13-04.jsonld b/data/temporalEntities/expectations/vehicles-bus-temporal-representation-021-13-04.jsonld new file mode 100644 index 00000000..13ed6526 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-bus-temporal-representation-021-13-04.jsonld @@ -0,0 +1,58 @@ +[ + { + "id": "urn:ngsi-ld:Vehicle:8312244306646236", + "type": "Vehicle", + "speed": [], + "fuelLevel": [] + }, + { + "id": "urn:ngsi-ld:Vehicle:6947937731280818", + "type": "Vehicle", + "speed": [ + { + "type": "Property", + "value": 120, + "instanceId": "urn:ngsi-ld:Instance:d014dcc4-7a02-4c8d-82f6-60abb1ce93b4", + "observedAt": "2020-09-01T12:03:00Z" + }, + { + "type": "Property", + "value": 80, + "instanceId": "urn:ngsi-ld:Instance:a335ad40-631a-4b60-a100-02baeefd23ba", + "observedAt": "2020-09-01T12:05:00Z" + }, + { + "type": "Property", + "value": 100, + "instanceId": "urn:ngsi-ld:Instance:65708f24-ac8f-4f37-992a-50359278595d", + "observedAt": "2020-09-01T12:07:00Z" + } + ], + "fuelLevel": [ + { + "type": "Property", + "value": 67, + "instanceId": "urn:ngsi-ld:Instance:deb11936-e5a4-493a-9b67-47d554842474", + "observedAt": "2020-09-01T12:03:00Z" + }, + { + "type": "Property", + "value": 53, + "instanceId": "urn:ngsi-ld:Instance:92b5097a-2c98-48f9-b910-73899e1b2751", + "observedAt": "2020-09-01T13:05:00Z" + }, + { + "type": "Property", + "value": 40, + "instanceId": "urn:ngsi-ld:Instance:6ebcf109-a31e-4b7c-a6c3-f614d6a6d278", + "observedAt": "2020-09-01T14:07:00Z" + } + ] + }, + { + "id": "urn:ngsi-ld:Bus:8760704607054204", + "type": "Bus", + "speed": [], + "fuelLevel": [] + } +] \ No newline at end of file diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 8658f815..5edd5a87 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -94,13 +94,11 @@ Query Entities Query Entities Via POST [Arguments] - ... ${entity_id}=${EMPTY} - ... ${entity_type}=${EMPTY} + ... ${entities}=${EMPTY} ... ${content_type}=${CONTENT_TYPE_JSON} ... ${accept}=${CONTENT_TYPE_JSON} ... ${context}=${EMPTY} ... ${attrs}=${EMPTY} - ... ${entity_id_pattern}=${EMPTY} ... ${geometry_property}=${EMPTY} &{headers}= Create Dictionary Set To Dictionary ${headers} Content-Type ${content_type} @@ -112,20 +110,9 @@ Query Entities Via POST END &{body}= Create Dictionary Set To Dictionary ${body} type=Query - &{entities}= Create Dictionary - IF '${entity_id}'!='' - Set To Dictionary ${entities} id=${entity_id} - END - IF '${entity_type}'!='' - Set To Dictionary ${entities} type=${entity_type} - END - IF '${entity_id_pattern}'!='' - Set To Dictionary ${entities} idPattern=${entity_id_pattern} - END ${entities_length}= Get Length ${entities} IF ${entities_length}>0 - ${entities_list}= Create List ${entities} - Set To Dictionary ${body} entities=${entities_list} + Set To Dictionary ${body} entities=${entities} END ${attrs_length}= Get Length ${attrs} IF ${attrs_length}>0 Set To Dictionary ${body} attrs=${attrs} -- GitLab From 84ba985e7ecfabe8e203b63394e6fa826cb679a3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 5 Nov 2024 18:50:11 +0100 Subject: [PATCH 2/3] doc: add new TC / permutation and update query entities via POST definition --- doc/analysis/requests.py | 15 +++----- .../Consumption/019_02_06.json | 38 +++++++++++++++++++ .../Consumption/021_13.json | 28 +++++++++++--- .../test_ContextInformation_Consumption.py | 7 ++++ 4 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 doc/files/ContextInformation/Consumption/019_02_06.json diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index d76c4308..3899e01e 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -89,8 +89,8 @@ class Requests: }, 'Query Entities Via POST': { 'positions': [], - 'params': ['entity_ids', 'entity_type', 'content_type', 'accept', - 'context', 'attrs', 'entity_id_pattern', 'geometry_property'] + 'params': ['entities', 'content_type', 'accept', + 'context', 'attrs', 'geometry_property'] }, 'Retrieve Temporal Representation Of Entity': { 'positions': [], @@ -1249,8 +1249,7 @@ class Requests: return response def query_entities_via_post(kwargs) -> str: - expected_parameters = ['entity_id', 'entity_type', 'content_type', 'accept', - 'attrs', 'entity_id_pattern', 'geometry_property'] + expected_parameters = ['entities', 'content_type', 'accept', 'attrs', 'geometry_property'] if 'content_type' not in kwargs: kwargs['content_type'] = 'application/json' @@ -1262,10 +1261,8 @@ class Requests: response = "Get Entities Via POST Request:" for key, value in kwargs.items(): match key: - case 'entity_id': - response = f"{response} and\n Query Parameter: entity_ids set to '{value}'" - case 'entity_type': - response = f"{response} and\n Query Parameter: entity_types set to '{value}'" + case 'entities': + response = f"{response} and\n Query Parameter: entities set to '{value}'" case 'content_type': response = f"{response} and\n Query Parameter: content_type set to '{value}'" case 'accept': @@ -1276,8 +1273,6 @@ class Requests: response = f"{response} and\n Query Parameter: attrs set to '{value}'" case 'geometry_property': response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" - case 'entity_id_pattern': - response = f"{response} and\n Query Parameter: entity_id_pattern set to '{value}'" case _: raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " f"'{expected_parameters}', but received: {kwargs}") diff --git a/doc/files/ContextInformation/Consumption/019_02_06.json b/doc/files/ContextInformation/Consumption/019_02_06.json new file mode 100644 index 00000000..11217210 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_02_06.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_06", + "test_objective": "Check that one can query two entities via POST Interaction based on ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "5.7.2" + ], + "pics_selection": "", + "keywords": [ + "Create Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_02_06 Query two entities via POST Interaction based on ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_06", + "doc": "Check that one can query two entities via POST Interaction based on ids", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-minimal.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entities set to '${entities}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_06" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_13.json b/doc/files/ContextInformation/Consumption/021_13.json index 5bd50cf4..597a9170 100644 --- a/doc/files/ContextInformation/Consumption/021_13.json +++ b/doc/files/ContextInformation/Consumption/021_13.json @@ -17,7 +17,7 @@ "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an a list of Temporal Entities \n}", "test_cases": [ { - "name": "021_13_01 After", + "name": "021_13_01 After One Entity", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_01", "doc": "Check that one can query the temporal evolution of entities using the entityOperations method", "tags": [ @@ -28,12 +28,12 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-01.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" }, { - "name": "021_13_02 Before", + "name": "021_13_02 Before One Entity", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_02", "doc": "Check that one can query the temporal evolution of entities using the entityOperations method", "tags": [ @@ -44,12 +44,12 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-02.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-before-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-before-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" }, { - "name": "021_13_03 Between", + "name": "021_13_03 Between One Entity", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_03", "doc": "Check that one can query the temporal evolution of entities using the entityOperations method", "tags": [ @@ -60,7 +60,23 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-03.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-between-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-between-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entityOperations/query" + }, + { + "name": "021_13_04 After Two Entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_13_04", + "doc": "Check that one can query the temporal evolution of entities using the entityOperations method", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": "Setup Initial Temporal Entities", + "teardown": "Delete Initial Temporal Entities", + "template": "Query the temporal evolution of entities using the entityOperations method", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-bus-temporal-representation-021-13-04.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query-two-entities.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" } diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index ad5f3013..4a382688 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -175,6 +175,13 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_019_02_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_02_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_019_03_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_03_01.json' -- GitLab From b8ce954e2741e03735d13ab11ac90560934381e2 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 6 Nov 2024 11:15:02 +0100 Subject: [PATCH 3/3] fix: use context hosted on the test suite repository --- doc/files/ContextInformation/Consumption/021_13.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/files/ContextInformation/Consumption/021_13.json b/doc/files/ContextInformation/Consumption/021_13.json index 597a9170..1d95211d 100644 --- a/doc/files/ContextInformation/Consumption/021_13.json +++ b/doc/files/ContextInformation/Consumption/021_13.json @@ -28,7 +28,7 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-01.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" }, @@ -44,7 +44,7 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-02.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-before-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-before-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" }, @@ -60,7 +60,7 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-13-03.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-between-query.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-between-query.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" }, @@ -76,7 +76,7 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities using the entityOperations method", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 200 and\n Query Temporal Representation Of Entities Via Post with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-bus-temporal-representation-021-13-04.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query-two-entities.jsonld' and\n Query Parameter: Link set to '<$https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to 'entity-operations-after-query-two-entities.jsonld' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "temporal/entityOperations/query" } -- GitLab