diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_15.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_15.robot new file mode 100644 index 0000000000000000000000000000000000000000..f748917376673f08a67a73ec2be976435402a6a7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_15.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation Check that one can retrieve an entity with format or options query params + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Created Entity +Test Template Retrieve Entity With Format Or Options Query Params + + +*** Variables *** +${filename}= building-simple-attributes.jsonld + + +*** Test Cases *** FORMAT_VALUE OPTIONS_VALUE EXPECTATION_FILENAME +018_15_01 RetrieveWithKeyValuesFormat + [Documentation] Check that one can retrieve with format query param having keyValues value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + keyValues ${EMPTY} building-simple-attributes-simplified.jsonld +018_15_02 RetrieveWithSimplifiedFormat + [Documentation] Check that one can retrieve with format query param having simplified value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + simplified ${EMPTY} building-simple-attributes-simplified.jsonld +018_15_03 RetrieveWithNormalizedFormat + [Documentation] Check that one can retrieve with format query param having normalized value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + normalized ${EMPTY} building-simple-attributes.jsonld +018_15_04 RetrieveWithKeyValuesOptions + [Documentation] Check that one can retrieve with options query param having keyValues value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + ${EMPTY} keyValues building-simple-attributes-simplified.jsonld +018_15_05 RetrieveWithSimplifiedOptions + [Documentation] Check that one can retrieve with options query param having simplified value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + ${EMPTY} simplified building-simple-attributes-simplified.jsonld +018_15_06 RetrieveWithNormalizedOptions + [Documentation] Check that one can retrieve with options query param having normalized value + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + ${EMPTY} normalized building-simple-attributes.jsonld +018_15_07 RetrieveWithFormatAndOptions + [Documentation] Check that one can retrieve with both format and options query params + [Tags] e-retrieve 5_7_1 6_3_7 since_v1.8.1 + keyValues normalized building-simple-attributes-simplified.jsonld + + +*** Keywords *** +Retrieve Entity With Format Or Options Query Params + [Documentation] Retrieve an entity giving format or options query params different values + [Arguments] ${format_value} ${options_value} ${expectation_filename} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... format=${format_value} + ... options=${options_value} + + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response.json()} + ... ${True} + +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Suite Variable ${entity_id} + ${create_response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + +Delete Created Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_16.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_16.robot new file mode 100644 index 0000000000000000000000000000000000000000..dd24d365b1a5df2e990f9ea85e7ea4dd754dc035 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_16.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation Check that retrieve entity returns an error when queried with faulty format or options query params + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Entity With Faulty Format Or Options Query Params + + +*** Variables *** +${filename}= building-simple-attributes.jsonld + + +*** Test Cases *** FORMAT_VALUE OPTIONS_VALUE +018_16_01 RetriveWithInvalidFormat + [Documentation] Check that retrieving an entity with invalid format query param returns an error + [Tags] e-retrieve 5_7_1 6_3_7 6_3_20 since_v1.8.1 + invalidFormat ${EMPTY} +018_16_02 RetriveWithInvalidOptions + [Documentation] Check that retrieving an entity with invalid options query param returns an error + [Tags] e-retrieve 5_7_1 6_3_7 6_3_20 since_v1.8.1 + ${EMPTY} invalidOptions +018_16_03 RetriveWithAtLeastOneInvalidOptions + [Documentation] Check that retrieving an entity with at least one invalid options query param returns an error + [Tags] e-retrieve 5_7_1 6_3_7 6_3_20 since_v1.8.1 + ${EMPTY} keyValues,invalid +018_16_04 RetriveWithOneInvalidQueryParam + [Documentation] Check that retrieving an entity with one invalid query param returns an error + [Tags] e-retrieve 5_7_1 6_3_7 6_3_20 since_v1.8.1 + keyValues invalid + + +*** Keywords *** +Retrieve Entity With Faulty Format Or Options Query Params + [Documentation] Retrieve Entity with faulty format or options query params and check the returned error + [Arguments] ${format_value} ${options_value} + ${entity_id}= Generate Random Building Entity Id + Set Suite Variable ${entity_id} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... format=${format_value} + ... options=${options_value} + + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_INVALID_REQUEST} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_19.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_19.robot new file mode 100644 index 0000000000000000000000000000000000000000..b463e3d0642c9ef4ab55707c4a0c99e62586b03e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_19.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Check that one can query the temporal evolution of an entity with format or options query params + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query The Temporal Evolution of An Entity With Format Or Options Query Params + + +*** Variables *** +${first_vehicle_payload_file}= 2020-08-vehicle-temporal-representation.jsonld +${second_vehicle_payload_file}= 2020-09-vehicle-temporal-representation.jsonld + + +*** Test Cases *** FORMAT_VALUE OPTIONS_VALUE AGGRMETHODS EXPECTATION_FILENAME +021_19_01 QueryWithFormatOnly + [Documentation] Check that one can query the temporal evolution with format query param only + [Tags] te-retrieve 5_7_3 6_3_12 since_v1.8.1 + temporalValues ${EMPTY} ${EMPTY} vehicles-temporal-representation-021-19-01.json +021_19_02 QueryWithFormatAndOptions + [Documentation] Check that if both format and options are present, the value of the format parameter takes precedence + [Tags] te-retrieve 5_7_3 6_3_12 since_v1.8.1 + temporalValues aggregatedValues sum vehicles-temporal-representation-021-19-01.json +021_19_03 QueryWithOptionsOnly + [Documentation] Check that one can query the temporal evolution with options query param only + [Tags] te-retrieve 5_7_3 6_3_12 since_v1.8.1 + ${EMPTY} temporalValues ${EMPTY} vehicles-temporal-representation-021-19-01.json + + +*** Keywords *** +Query The Temporal Evolution of An Entity With Format Or Options Query Params + [Documentation] Query the temporal evolution of an entity giving format or options query params different values + [Arguments] ${format_value} ${options_value} ${aggr_methods} ${expectation_file} + @{types}= Create List Vehicle + + ${response}= Query Temporal Representation Of Entities + ... entity_types=${types} + ... options=${options_value} + ... format=${format_value} + ... aggrMethods=${aggr_methods} + ... context=${ngsild_test_suite_context} + ... timerel=after + ... timeAt=2020-01-01T12:03:00Z + + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${response.json()} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Catenate ${VEHICLE_ID_PREFIX}021-19-A + ${create_response1}= Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Catenate ${VEHICLE_ID_PREFIX}021-19-B + ${create_response2}= Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_20.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_20.robot new file mode 100644 index 0000000000000000000000000000000000000000..e93ded4ea2f26a4f4f16c2059572b90515606b31 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_20.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that one cannot query the temporal evolution of entities when called with faulty format or options query params + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params + + +*** Variables *** +${vehicle_payload_file}= 2020-08-vehicle-temporal-representation.jsonld + + +*** Test Cases *** FORMAT_VALUE OPTIONS_VALUE +021_20_01 QueryWithInvalidFormat + [Documentation] Check that one cannot query with an invalid format query param + [Tags] te-retrieve 5_7_3 6_3_12 6_3_20 since_v1.8.1 + invalidFormat ${EMPTY} +021_20_02 QueryWithInvalidOptions + [Documentation] Check that one cannot query with an invalid options query param + [Tags] te-retrieve 5_7_3 6_3_12 6_3_20 since_v1.8.1 + ${EMPTY} invalidOptions +021_20_03 QueryWithAtLeastOneInvalidOptions + [Documentation] Check that one cannot query with at least one invalid options query param + [Tags] te-retrieve 5_7_3 6_3_12 6_3_20 since_v1.8.1 + ${EMPTY} temporalValues,invalidOptions +021_20_04 QueryWithOneInvalidQueryParam + [Documentation] Check that one cannot query with at least one invalid query param + [Tags] te-retrieve 5_7_3 6_3_12 6_3_20 since_v1.8.1 + temporalValues aggregatedValues,invalidOptions + + +*** Keywords *** +Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params + [Documentation] Query the temporal evolution of an entity with faulty format or options query params and check the returned error + [Arguments] ${format_value} ${options_value} + @{types}= Create List Vehicle + ${temporal_entity_representation_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${temporal_entity_representation_id} + + ${response}= Query Temporal Representation Of Entities + ... entity_types=${types} + ... options=${options_value} + ... format=${format_value} + ... context=${ngsild_test_suite_context} + ... timerel=after + ... timeAt=2020-01-01T12:03:00Z + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_INVALID_REQUEST} diff --git a/data/temporalEntities/expectations/2020-08-vehicle-temporal-representation-temporal-values.json b/data/temporalEntities/expectations/2020-08-vehicle-temporal-representation-temporal-values.json new file mode 100644 index 0000000000000000000000000000000000000000..b7eca37ac7d33ea2501bfbec5fa63f747ae97621 --- /dev/null +++ b/data/temporalEntities/expectations/2020-08-vehicle-temporal-representation-temporal-values.json @@ -0,0 +1,42 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-08-01T12:03:00Z" + + ], + [ + 53.0, + "2020-08-01T13:05:00Z" + ], + [ + 40.0, + "2020-08-01T14:07:00Z" + ] + + ] + }, + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-08-01T12:03:00Z" + + ], + [ + 80.0, + "2020-08-01T12:05:00Z" + ], + [ + 100.0, + "2020-08-01T12:07:00Z" + ] + + ] + } +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-19-01.json b/data/temporalEntities/expectations/vehicles-temporal-representation-021-19-01.json new file mode 100644 index 0000000000000000000000000000000000000000..027270f03b12ea6519dcea09cf3d27972e85322a --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-19-01.json @@ -0,0 +1,78 @@ +[ + { + "id": "urn:ngsi-ld:Vehicle:021-19-A", + "type": "Vehicle", + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-08-01T12:03:00Z" + ], + [ + 53.0, + "2020-08-01T13:05:00Z" + ], + [ + 40.0, + "2020-08-01T14:07:00Z" + ] + ] + }, + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-08-01T12:03:00Z" + ], + [ + 80.0, + "2020-08-01T12:05:00Z" + ], + [ + 100.0, + "2020-08-01T12:07:00Z" + ] + ] + } + }, + { + "id": "urn:ngsi-ld:Vehicle:021-19-B", + "type": "Vehicle", + "fuelLevel": { + "type": "Property", + "values": [ + [ + 67.0, + "2020-09-01T12:03:00Z" + ], + [ + 53.0, + "2020-09-01T13:05:00Z" + ], + [ + 40.0, + "2020-09-01T14:07:00Z" + ] + ] + }, + "speed": { + "type": "Property", + "values": [ + [ + 120.0, + "2020-09-01T12:03:00Z" + ], + [ + 80.0, + "2020-09-01T12:05:00Z" + ], + [ + 100.0, + "2020-09-01T12:07:00Z" + ] + ] + } + } +] \ No newline at end of file diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index d18b0f79838784b174127674629720e0e353cea7..40f2ef5afbadc38ac6df793a38cd948495fa1a45 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -38,7 +38,7 @@ class Requests: }, 'Query Entity': { 'positions': [], - 'params': ['id', 'accept', 'attrs', 'context', 'geometryProperty', 'options', 'lang', 'join', 'joinLevel'] + 'params': ['id', 'accept', 'attrs', 'context', 'geometryProperty', 'options', 'format', 'lang', 'join', 'joinLevel'] }, 'Retrieve Subscription': { 'positions': [], @@ -70,7 +70,7 @@ class Requests: 'params': ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', 'ngsild_query', 'csf', 'georel', 'geometry', 'coordinates', 'geoproperty', 'timerel', 'timeAt', 'endTimeAt', - 'attrs', 'limit', 'lastN', 'accept', 'options', 'datasetId', + 'attrs', 'limit', 'lastN', 'accept', 'options', 'format', 'datasetId', 'aggrMethods', 'aggrPeriodDuration'] }, 'Query Temporal Representation Of Entities Via Post': { @@ -813,7 +813,7 @@ class Requests: @staticmethod def query_entity(kwargs) -> str: - expected_parameters = ['id', 'accept', 'attrs', 'context', 'geometry_property', 'options', 'lang', 'join', 'joinLevel'] + expected_parameters = ['id', 'accept', 'attrs', 'context', 'geometry_property', 'options', 'format', 'lang', 'join', 'joinLevel'] result = [x for x in kwargs if x not in expected_parameters] response = "Get Entity Request:" @@ -832,6 +832,8 @@ class Requests: response = f"{response} and\n Query Parameter: geometryProperty set to '{value}'" case 'options': response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'format': + response = f"{response} and\n Query Parameter: format set to '{value}'" case 'lang': response = f"{response} and\n Query Parameter: lang set to '{value}'" case 'join': @@ -1169,7 +1171,7 @@ class Requests: expected_parameters = ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', 'ngsild_query', 'csf', 'georel', 'geometry', 'coordinates', 'geoproperty', 'timerel', 'timeAt','endTimeAt', - 'attrs', 'limit', 'lastN', 'accept', 'options', 'datasetId', 'aggrMethods','aggrPeriodDuration'] + 'attrs', 'limit', 'lastN', 'accept', 'options', 'format', 'datasetId', 'aggrMethods','aggrPeriodDuration'] result = [x for x in kwargs if x not in expected_parameters] response = "Query Temporal Representation of Entities" @@ -1213,6 +1215,8 @@ class Requests: response = f"{response} and\n Query Parameter: accept set to '{value}'" case 'options': response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'format': + response = f"{response} and\n Query Parameter: format set to '{value}'" case 'aggrMethods': response = f"{response} and\n Query Parameter: aggrMethods set to '{value}'" case 'aggrPeriodDuration': diff --git a/doc/files/ContextInformation/Consumption/018_15.json b/doc/files/ContextInformation/Consumption/018_15.json new file mode 100644 index 0000000000000000000000000000000000000000..cf786653080e031ad3617ca92c03a45d7eb707e4 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_15.json @@ -0,0 +1,153 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_15", + "test_objective": "Check that one can retrieve an entity with format or options query params", + "reference": "ETSI GS CIM 009 V1.8.1 [], clauses 5.7.1, 6.3.7", + "config_id": "", + "parent_release": "v1.8.1", + "clauses": [ + "5.7.1", + "6.3.7" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity With Format Or Options Query Params", + "Create Initial Entity", + "Delete Created Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "018_15_01 RetrieveWithKeyValuesFormat", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_01", + "doc": "Check that one can retrieve with format query param having keyValues value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'keyValues' and\n Query Parameter: options set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_02 RetrieveWithSimplifiedFormat", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_02", + "doc": "Check that one can retrieve with format query param having simplified value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'simplified' and\n Query Parameter: options set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_03 RetrieveWithNormalizedFormat", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_03", + "doc": "Check that one can retrieve with format query param having normalized value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'normalized' and\n Query Parameter: options set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_04 RetrieveWithKeyValuesOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_04", + "doc": "Check that one can retrieve with options query param having keyValues value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: options set to 'keyValues'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_05 RetrieveWithSimplifiedOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_05", + "doc": "Check that one can retrieve with options query param having simplified value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: options set to 'simplified'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_06 RetrieveWithNormalizedOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_06", + "doc": "Check that one can retrieve with options query param having normalized value", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: options set to 'normalized'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_15_07 RetrieveWithFormatAndOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_15_07", + "doc": "Check that one can retrieve with both format and options query params", + "tags": [ + "5_7_1", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Created Entity", + "template": "Retrieve Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-simple-attributes-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'keyValues' and\n Query Parameter: options set to 'normalized'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_15" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_16.json b/doc/files/ContextInformation/Consumption/018_16.json new file mode 100644 index 0000000000000000000000000000000000000000..a75599b0b545c0c3fd80299a7bb64d8ed80d90b5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_16.json @@ -0,0 +1,101 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_16", + "test_objective": "Check that retrieve entity returns an error when queried with faulty format or options query params", + "reference": "ETSI GS CIM 009 V1.8.1 [], clauses 5.7.1, 6.3.20, 6.3.7", + "config_id": "", + "parent_release": "v1.8.1", + "clauses": [ + "5.7.1", + "6.3.20", + "6.3.7" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity With Faulty Format Or Options Query Params" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_16_01 RetriveWithInvalidFormat", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_16_01", + "doc": "Check that retrieving an entity with invalid format query param returns an error", + "tags": [ + "5_7_1", + "6_3_20", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 400 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'invalidFormat' and\n Query Parameter: options set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_16_02 RetriveWithInvalidOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_16_02", + "doc": "Check that retrieving an entity with invalid options query param returns an error", + "tags": [ + "5_7_1", + "6_3_20", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 400 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: options set to 'invalidOptions'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_16_03 RetriveWithAtLeastOneInvalidOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_16_03", + "doc": "Check that retrieving an entity with at least one invalid options query param returns an error", + "tags": [ + "5_7_1", + "6_3_20", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 400 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: options set to 'keyValues,invalid'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_16_04 RetriveWithOneInvalidQueryParam", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_16_04", + "doc": "Check that retrieving an entity with one invalid query param returns an error", + "tags": [ + "5_7_1", + "6_3_20", + "6_3_7", + "e-retrieve", + "since_v1.8.1" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 400 and\n Query Entity with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: format set to 'keyValues' and\n Query Parameter: options set to 'invalid'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_16" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_19.json b/doc/files/ContextInformation/Consumption/021_19.json new file mode 100644 index 0000000000000000000000000000000000000000..9d36fed588f87e8f6408e08b620d2885edf1f8bb --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_19.json @@ -0,0 +1,80 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_19", + "test_objective": "Check that one can query the temporal evolution of an entity with format or options query params", + "reference": "ETSI GS CIM 009 V1.8.1 [], clauses 5.7.3, 6.3.12", + "config_id": "", + "parent_release": "v1.8.1", + "clauses": [ + "5.7.3", + "6.3.12" + ], + "pics_selection": "", + "keywords": [ + "Query The Temporal Evolution of An Entity With Format Or Options Query Params", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_19_01 QueryWithFormatOnly", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_19_01", + "doc": "Check that one can query the temporal evolution with format query param only", + "tags": [ + "5_7_3", + "6_3_12", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file '${expectation_file}'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: format set to 'temporalValues' and\n Query Parameter: aggrMethods set to '${aggr_methods}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_19_02 QueryWithFormatAndOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_19_02", + "doc": "Check that one can query the temporal evolution with both format and options query params", + "tags": [ + "5_7_3", + "6_3_12", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file '${expectation_file}'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to 'aggregatedValues' and\n Query Parameter: format set to 'temporalValues' and\n Query Parameter: aggrMethods set to '${aggr_methods}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_19_03 QueryWithOptionsOnly", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_19_03", + "doc": "Check that one can query the temporal evolution with options query param only", + "tags": [ + "5_7_3", + "6_3_12", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file '${expectation_file}'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to 'temporalValues' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: aggrMethods set to '${aggr_methods}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_19" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_20.json b/doc/files/ContextInformation/Consumption/021_20.json new file mode 100644 index 0000000000000000000000000000000000000000..b015115eb178b47c403f9d5942590e3424db1412 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_20.json @@ -0,0 +1,101 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_20", + "test_objective": "Check that one cannot query the temporal evolution of entities when called with faulty format or options query params", + "reference": "ETSI GS CIM 009 V1.8.1 [], clauses 5.7.3, 6.3.12, 6.3.20", + "config_id": "", + "parent_release": "v1.8.1", + "clauses": [ + "5.7.3", + "6.3.12", + "6.3.20" + ], + "pics_selection": "", + "keywords": [ + "Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_20_01 QueryWithInvalidFormat", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_20_01", + "doc": "Check that one cannot query with an invalid format query param", + "tags": [ + "5_7_3", + "6_3_12", + "6_3_20", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 400 and\n Query Temporal Representation Of Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: format set to 'invalidFormat' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_20_02 QueryWithInvalidOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_20_02", + "doc": "Check that one cannot query with an invalid options query param", + "tags": [ + "5_7_3", + "6_3_12", + "6_3_20", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 400 and\n Query Temporal Representation Of Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to 'invalidOptions' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_20_03 QueryWithAtLeastOneInvalidOptions", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_20_03", + "doc": "Check that one cannot query with at least one invalid options query param", + "tags": [ + "5_7_3", + "6_3_12", + "6_3_20", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 400 and\n Query Temporal Representation Of Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to 'temporalValues,invalidOptions' and\n Query Parameter: format set to '${EMPTY}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_20_04 QueryWithOneInvalidQueryParam", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_20_04", + "doc": "Check that one cannot query with at least one invalid query param", + "tags": [ + "5_7_3", + "6_3_12", + "6_3_20", + "since_v1.8.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Query The Temporal Evolution of An Entity With Faulty Format Or Options Query Params", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 400 and\n Query Temporal Representation Of Entities with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${types}' and\n Query Parameter: options set to 'aggregatedValues,invalidOptions' and\n Query Parameter: format set to 'temporalValues' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-01-01T12:03:00Z'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_20" +} \ No newline at end of file diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index c57ae2dc4752d145b4247d5a8d05361293711732..ca5a3c63cf24adfacdc31abea271b11d6121bbfe 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -420,6 +420,20 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_018_15(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_15.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_15.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_15.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_16(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_16.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_16.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_16.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_021_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_01.json' @@ -538,6 +552,20 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_021_19(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_19.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_19.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_19.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_20(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_20.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_20.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_20.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_020_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_01.json' diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 0ccb17375c302346e005e710aeda2ddd5c497f94..a80e892a8099b19c168ae0a102ea68f1d9949e10 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -150,12 +150,14 @@ Query Entity ... ${context}=${EMPTY} ... ${geometryProperty}=${EMPTY} ... ${options}=${EMPTY} + ... ${format}=${EMPTY} ... ${lang}=${EMPTY} ... ${join}=${EMPTY} ... ${joinLevel}=${EMPTY} ${attrs_length}= Get Length ${attrs} ${accept_length}= Get Length ${accept} ${options_length}= Get Length ${options} + ${format_length}= Get Length ${format} ${lang_length}= Get Length ${lang} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -175,6 +177,9 @@ Query Entity IF ${options_length}>0 Set To Dictionary ${params} options=${options} END + IF ${format_length}>0 + Set To Dictionary ${params} format=${format} + END IF ${lang_length}>0 Set To Dictionary ${params} lang=${lang} IF '${join}'!='' Set To Dictionary ${params} join=${join} IF '${join_level}'!='' diff --git a/resources/ApiUtils/TemporalContextInformationConsumption.resource b/resources/ApiUtils/TemporalContextInformationConsumption.resource index dd409028c9e6c664bb1f140dd250231e354afea0..da368ad9ba0a513600f766845afe65364c08c1c3 100755 --- a/resources/ApiUtils/TemporalContextInformationConsumption.resource +++ b/resources/ApiUtils/TemporalContextInformationConsumption.resource @@ -40,6 +40,7 @@ Query Temporal Representation Of Entities ... ${lastN}=${EMPTY} ... ${accept}=${EMPTY} ... ${options}=${EMPTY} + ... ${format}=${EMPTY} ... ${aggrMethods}=${EMPTY} ... ${aggrPeriodDuration}=${EMPTY} ... ${datasetId}=${EMPTY} @@ -87,6 +88,7 @@ Query Temporal Representation Of Entities END IF $limit!='' Set To Dictionary ${params} limit=${limit} IF $options!='' Set To Dictionary ${params} options=${options} + IF $format!='' Set To Dictionary ${params} format=${format} IF $aggrMethods!='' Set To Dictionary ${params} aggrMethods=${aggrMethods} END diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index b5fcb0127a9294cd986a753a57a15f7c5e66d4e7..a4d70b75d0040a3e9c592764a25bd71d20e34a4b 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -233,14 +233,14 @@ Check Response Body Containing EntityTemporal element Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements - [Arguments] ${filename} ${response_body} + [Arguments] ${filename} ${response_body} ${group_by}=id ${temporal_entities_representation_payload}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entities_representation_payload} ... ${response_body} ... ${instance_id_regex_expr} - ... group_by=id + ... group_by=${group_by} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element