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 9fa9533eda21a8519ffdc41eddf6f517efed97e9..3d0d9fa0fb4a0b4689342aa8dfeabc35170ecb36 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 @@ -44,7 +44,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities + ${response}= Query Entities Via POST ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} 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 9c61a79e1f4f724909d3a58a4d453b367338f7dd..168f397cad2db6bd9d25a17e0acc7907b4b632a5 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 @@ -49,7 +49,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking Check Response Status Code 201 ${response.status_code} @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} 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_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 86d068e65d645d594e23bbbcc89de52cee421041..3ac2651056c757a000ee83f4cc3f39143879cc2b 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 @@ -37,7 +37,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities + ${response}= Query Entities Via POST ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index d6e227b866d9a4b8d0198733b48bce22544dbe28..58a65d1ed9f7414146fb55785fab5b5efc226d1c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -40,7 +40,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego ... ${attribute_airqualitylevel} ... ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} - ${response}= Query Entities attrs=${attributes_to_be_retrieved} + ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} 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 849a2a13d27146720153b07564ed3c32377e4e1e..accbccb26bdf3d75c6be905f3558752d0feabc80 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 @@ -37,7 +37,7 @@ ${geometry_property}= location Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities + ${response}= Query Entities Via POST ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} Check Response Status Code 200 ${response.status_code} diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 442f29293267a542a5dbeccc9c8577dcec56175a..281890a5fe32df55a1eba3d6a4649a65d4d8cc76 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -7,17 +7,18 @@ Library RequestsLibrary *** Variables *** -${ATTRIBUTES_ENDPOINT_PATH} attributes -${ENTITIES_ENDPOINT_PATH} entities/ -${ENTITIES_TYPES_ENDPOINT_PATH} types +${ATTRIBUTES_ENDPOINT_PATH} attributes +${ENTITIES_ENDPOINT_PATH} entities/ +${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query +${ENTITIES_TYPES_ENDPOINT_PATH} types -${CONTENT_TYPE_LD_JSON} application/ld+json +${CONTENT_TYPE_LD_JSON} application/ld+json -${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${response} ${EMPTY} +${response} ${EMPTY} *** Keywords *** @@ -83,6 +84,41 @@ Query Entities Output ${response} Query Entities RETURN ${response} +Query Entities Via POST + [Arguments] + ... ${entity_ids}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${attrs}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${geoproperty}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${entity_ids_length}= Get Length ${entity_ids} + ${entity_types_length}= Get Length ${entity_types} + ${attrs_length}= Get Length ${attrs} + Set To Dictionary ${headers} Content-Type ${content_type} + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + ${response}= POST + ... url=${url}/${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} + ... json=${params} + ... headers=${headers} + ... expected_status=any + Output ${response} Query Entities Via POST + RETURN ${response} + Query Entity [Arguments] ... ${id}