From 35c9d5d3f23a0761adebcb40e88eae34b4e512cb Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 4 Jul 2024 21:41:11 +0200 Subject: [PATCH 1/7] refactoring for ContextInformation/Consumption --- .../027_01.robot | 3 +- .../027_02.robot | 3 +- .../RetrieveAvailableAttributes/025_01.robot | 3 +- .../024_01.robot | 8 +++-- .../024_02.robot | 8 +++-- .../RetrieveAvailableEntityTypes/022_01.robot | 8 +++-- .../026_01.robot | 3 +- .../023_01.robot | 8 +++-- .../Entity/QueryEntities/019_01_01.robot | 31 +++++++++------- .../Entity/QueryEntities/019_01_02.robot | 27 ++++++++------ .../Entity/QueryEntities/019_01_03.robot | 29 ++++++++------- .../Entity/QueryEntities/019_01_04.robot | 31 +++++++++------- .../Entity/QueryEntities/019_01_05.robot | 34 ++++++++++-------- .../Entity/QueryEntities/019_01_06.robot | 6 ++-- .../Entity/QueryEntities/019_03_01.robot | 29 ++++++++------- .../Entity/QueryEntities/019_03_02.robot | 29 ++++++++------- .../Entity/QueryEntities/019_03_03.robot | 27 ++++++++------ .../Entity/QueryEntities/019_03_04.robot | 23 +++++++----- .../Entity/QueryEntities/019_03_05.robot | 33 +++++++++-------- .../Entity/QueryEntities/019_04.robot | 33 +++++++++-------- .../Entity/QueryEntities/019_05.robot | 2 ++ .../Entity/QueryEntities/019_06.robot | 35 +++++++++++-------- .../Entity/RetrieveEntity/018_01_01.robot | 18 ++++++---- .../Entity/RetrieveEntity/018_01_02.robot | 19 ++++++---- .../Entity/RetrieveEntity/018_01_03.robot | 18 ++++++---- .../Entity/RetrieveEntity/018_03_02.robot | 19 ++++++---- .../Entity/RetrieveEntity/018_04.robot | 18 ++++++---- .../Entity/RetrieveEntity/018_05.robot | 1 + .../Entity/RetrieveEntity/018_06.robot | 3 +- .../021_01.robot | 19 ++++++---- .../021_02.robot | 12 ++++--- .../021_03.robot | 12 ++++--- .../021_04.robot | 12 ++++--- .../021_05.robot | 14 ++++++-- .../021_06.robot | 12 ++++--- .../021_07.robot | 12 ++++--- .../021_08.robot | 12 ++++--- .../021_09.robot | 12 ++++--- .../021_11.robot | 17 +++++---- .../021_12.robot | 5 ++- .../021_13.robot | 10 +++--- .../021_14.robot | 17 +++++---- .../020_01.robot | 5 ++- .../020_02.robot | 5 ++- .../020_03.robot | 5 ++- .../020_04.robot | 5 ++- .../020_05.robot | 5 ++- .../020_08.robot | 5 ++- .../020_09.robot | 5 ++- .../020_10.robot | 5 ++- .../020_11.robot | 5 ++- .../020_12.robot | 5 ++- 52 files changed, 454 insertions(+), 271 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot index 13de0208..7b589b0a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot @@ -30,11 +30,12 @@ ${filename}= building-simple-attributes-sample.json *** Keywords *** Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot index f4298288..b81f7f8f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot @@ -28,11 +28,12 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json *** Keywords *** Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 05096b7e..f51e3ee3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -36,11 +36,12 @@ Retrieve Available Attributes Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${entity_id} Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot index 8b5c51cb..8c77aa1b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot @@ -31,17 +31,19 @@ ${filename}= building-simple-attributes-sample.json Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Create Entity Selecting Content Type + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_entity_id} + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${first_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot index 6ebc8c6a..5416a277 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot @@ -29,17 +29,19 @@ ${expectation_file}= types/expectations/entity-type-info-024-01-expectati Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Create Entity Selecting Content Type + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_entity_id} + ${create_response2}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${first_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 93dc63ae..efc8b626 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -39,17 +39,19 @@ Retrieve Available Entity Types Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${first_filename} ... ${first_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Create Entity Selecting Content Type + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_entity_id} + ${create_response2}= Create Entity Selecting Content Type ... ${second_filename} ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Test Variable ${first_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index 035213c2..d5ebd20b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -37,11 +37,12 @@ Retrieve Details Of Available Attributes Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${entity_id} Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index e983ecfa..a1b62ddb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -40,17 +40,19 @@ Retrieve Details Of Available Entity Types Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${first_filename} ... ${first_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Create Entity Selecting Content Type + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_entity_id} + ${create_response2}= Create Entity Selecting Content Type ... ${second_filename} ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Test Variable ${first_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index 557217f7..cf39e221 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities Suite Teardown Delete Entities @@ -20,6 +21,23 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building 019_01_01 Query several entities based on ids [Documentation] Check that one can query several entities based on ids [Tags] e-query 5_7_2 + @{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 + ... entity_ids=${entities_ids_to_be_retrieved} + ... 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=${expectation_filename} + ... entities_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} + + +*** Keywords *** +Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -41,20 +59,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response3.status_code} - @{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 - ... entity_ids=${entities_ids_to_be_retrieved} - ... 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=${expectation_filename} - ... entities_ids=${entities_ids_to_be_compared} - ... response_body=${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index b5293c30..8c8476ea 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities Suite Teardown Delete Entities @@ -26,6 +27,21 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking 019_01_02 Query several entities based on the entities types [Documentation] Check that one can query several entities based on the entities types [Tags] e-query 5_7_2 + @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} + + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} + + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing Entity Elements With Different Types + ... filename=${expectation_filename} + ... entities_representation_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} + ... ignore_core_context_version=${True} + + +*** Keywords *** +Setup Initial Entities ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${building_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -47,18 +63,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response3.status_code} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response.status_code} - @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity Elements With Different Types - ... filename=${expectation_filename} - ... entities_representation_ids=${entities_ids_to_be_compared} - ... response_body=${response.json()} - ... ignore_core_context_version=${True} - -*** Keywords *** Delete Entities Delete Entity by Id ${building_entity_id} Delete Entity by Id ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index 6b293b76..1c044f6e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities Suite Teardown Delete Entities @@ -21,6 +22,22 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* 019_01_03 Query several entities based on the given id pattern [Documentation] Check that one can query several entities based on the given id pattern [Tags] e-query 5_7_2 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} + + ${response}= Query Entities + ... entity_id_pattern=${entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} + + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing Entity Elements + ... expectation_filename=${expectation_filename} + ... entities_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} + + +*** Keywords *** +Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -35,19 +52,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} - ${response}= Query Entities - ... entity_id_pattern=${entity_id_pattern} - ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity Elements - ... expectation_filename=${expectation_filename} - ... entities_ids=${entities_ids_to_be_compared} - ... response_body=${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index a0acab89..bc942adb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities Suite Teardown Delete Entities @@ -23,6 +24,23 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego 019_01_04 Query several entities based on attribute names [Documentation] Check that one can query several entities based on attribute names [Tags] e-query 5_7_2 + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} + + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + + 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 *** +Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -37,20 +55,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${attributes_to_be_retrieved}= Catenate - ... SEPARATOR=, - ... ${attribute_airqualitylevel} - ... ${attribute_subcategory} - @{entities_ids_to_be_compared}= Create List ${first_entity_id} - ${response}= Query Entities attrs=${attributes_to_be_retrieved} - 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 *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 97c771e4..8b699c8f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities Suite Teardown Delete Entities @@ -23,29 +24,16 @@ ${coordinates}= [13.3986, 52.5547] 019_01_05 Query several entities based on a geoquery [Documentation] Check that one can query entities based on a geoquery [Tags] e-query 5_7_2 - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${first_entity_id} - ${create_response1}= Create Entity Selecting Content Type - ... ${filename} - ... ${first_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response1.status_code} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${second_entity_id} - ${create_response2}= Create Entity Selecting Content Type - ... ${filename} - ... ${second_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response2.status_code} @{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 ... entity_types=${entity_types_to_be_retrieved} ... accept=${CONTENT_TYPE_LD_JSON} ... georel=${georal} ... geometry=${geometry} ... coordinates=${coordinates} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} @@ -55,6 +43,22 @@ ${coordinates}= [13.3986, 52.5547] *** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${create_response1}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response1.status_code} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} + ${create_response2}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} + Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_06.robot index b691af53..ead347f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_06.robot @@ -52,18 +52,20 @@ Query several entities based on scopes Setup Initial Entities ${entity_one_scope_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_one_scope_id} - Create Entity Selecting Content Type + ${create_response1}= Create Entity Selecting Content Type ... ${entity_one_scope} ... ${entity_one_scope_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response1.status_code} ${entity_many_scopes_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_many_scopes_id} - Create Entity Selecting Content Type + ${create_response2}= Create Entity Selecting Content Type ... ${entity_many_scopes} ... ${entity_many_scopes_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response2.status_code} Delete Entities Delete Entity by Id ${entity_one_scope_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index d5f651c3..d07d7d5c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -21,6 +22,22 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 019_03_01 Query entities based on incorrect ids [Documentation] Check that one cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + + +*** Keywords *** +Create Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -35,19 +52,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities - ... entity_ids=${entities_ids_to_be_retrieved} - ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index 7ce3496d..4aebd02f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -22,6 +23,22 @@ ${invalid_entity_type_two}= invalid_entity_type_two 019_03_02 Query entities based on incorrect entity types [Documentation] Check that one cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 + ${entity_types_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${invalid_entity_type_one} + ... ${invalid_entity_type_two} + + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + + +*** Keywords *** +Create Entities ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${building_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -36,19 +53,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${entity_types_to_be_retrieved}= Catenate - ... SEPARATOR=, - ... ${invalid_entity_type_one} - ... ${invalid_entity_type_two} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${building_entity_id} Delete Entity by Id ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 1068173e..a61ec755 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -20,6 +21,21 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern** 019_03_03 Query several entities based on incorrect id pattern [Documentation] Check that one cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + + ${response}= Query Entities + ... entity_id_pattern=${invalid_entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} + + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + + +*** Keywords *** +Create Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -34,18 +50,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern** ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities - ... entity_id_pattern=${invalid_entity_id_pattern} - ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 9871e7f6..edd0084f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -21,6 +22,19 @@ ${invalid_attribute_two}= type 019_03_04 Query several entities based on incorrect attribute names [Documentation] Check that one cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} + + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + + +*** Keywords *** +Create Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -35,16 +49,7 @@ ${invalid_attribute_two}= type ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} - ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 52214218..570a7570 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -23,21 +24,8 @@ ${geoproperty}= location 019_03_05 Query entities when the request has a wrong geometryProperty [Documentation] Check that one cannot query entities if the request has a wrong geometryProperty [Tags] e-query 5_7_2 - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${first_entity_id} - ${create_response1}= Create Entity Selecting Content Type - ... ${filename} - ... ${first_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response1.status_code} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${second_entity_id} - ${create_response2}= Create Entity Selecting Content Type - ... ${filename} - ... ${second_entity_id} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response2.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geoproperty} @@ -45,6 +33,7 @@ ${geoproperty}= location ... geometry=${geometry} ... coordinates=${coordinates} ... context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -53,6 +42,22 @@ ${geoproperty}= location *** Keywords *** +Create Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${create_response1}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response1.status_code} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} + ${create_response2}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} + Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index b729cb95..4a111049 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -21,6 +22,24 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building 019_04_01 Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] e-query 6_3_7 + @{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 + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... options=${options_parameter} + + 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} ${create_response1}= Create Entity Selecting Content Type @@ -42,21 +61,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response3.status_code} - @{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 - ... entity_ids=${entities_ids_to_be_retrieved} - ... entity_types=${entity_types_to_be_retrieved} - ... options=${options_parameter} - 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 *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index a963fa84..788e593c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -23,11 +23,13 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Tags] e-query 6_3_7 ${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 ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... accept=${CONTENT_TYPE_GEOJSON} ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Content ... expectation_filename=${expectation_filename} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 8d136195..091bdce4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entities Suite Teardown Delete Entities @@ -20,6 +21,25 @@ ${limit}= 2 019_06_01 Query entities specifying a maximum number of results [Documentation] Check that one can query entities specifying a maximum number of results [Tags] e-query 6_3_10 + ${entities_ids_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${first_entity_id} + ... ${second_entity_id} + ... ${third_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... limit=${limit} + + Check Response Status Code 200 ${response.status_code} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Number Of Entities ${entity_type} ${2} ${response.json()} + + +*** Keywords *** +Create Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type @@ -41,22 +61,7 @@ ${limit}= 2 ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response3.status_code} - ${entities_ids_to_be_retrieved}= Catenate - ... SEPARATOR=, - ... ${first_entity_id} - ... ${second_entity_id} - ... ${third_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities - ... entity_ids=${entities_ids_to_be_retrieved} - ... entity_types=${entity_types_to_be_retrieved} - ... limit=${limit} - Check Response Status Code 200 ${response.status_code} - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Number Of Entities ${entity_type} ${2} ${response.json()} - -*** Keywords *** Delete Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index cada5b4b..b6884f88 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entity Suite Teardown Delete Created Entity @@ -19,16 +20,10 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld 018_01_01 Get an entity by id [Documentation] Check that one can get an entity by id [Tags] e-retrieve 5_7_1 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - 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} ${response}= Query Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ... ${expectation_filename} @@ -38,5 +33,14 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Keywords *** +Create Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + 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_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 986ba73f..6a01d3c8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entity Suite Teardown Delete Created Entity @@ -21,21 +22,16 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego 018_01_02 Query some attributes from an entity [Documentation] Check that one can query some attributes from an entity [Tags] e-retrieve 5_7_1 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - 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} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} + ${response}= Query Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ... ${expectation_filename} @@ -45,5 +41,14 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Keywords *** +Create Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + 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_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index d4a7b7d2..0feda2c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entity Suite Teardown Delete Created Entity @@ -20,17 +21,11 @@ ${geometry_property}= location 018_01_03 Query the geometry property from an entity [Documentation] Check that one can query the geometry property from an entity [Tags] e-retrieve 5_7_1 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - 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} ${response}= Query Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_LD_JSON} ... geoproperty=${geometry_property} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ... ${expectation_filename} @@ -40,5 +35,14 @@ ${geometry_property}= location *** Keywords *** +Create Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + 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_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 97a35124..06d51d19 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Entity Suite Teardown Delete Created Entity @@ -19,18 +20,13 @@ ${attribute_not_known}= property_not_found 018_03_02 Get an entity if an attribute is not known to the system [Documentation] Check that one cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_7_1 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - 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} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} + ${response}= Query Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -39,5 +35,14 @@ ${attribute_not_known}= property_not_found *** Keywords *** +Create Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + 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_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 370df415..741f05a8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Entity Test Teardown Delete Created Entity @@ -20,17 +21,11 @@ ${options_parameter}= keyValues 018_04_01 Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Test 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} ${response}= Query Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_LD_JSON} ... options=${options_parameter} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ... ${expectation_filename} @@ -40,5 +35,14 @@ ${options_parameter}= keyValues *** Keywords *** +Create Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test 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_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index a06f8909..f6c6094a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -44,6 +44,7 @@ Create Initial Entity ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} Delete Created Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index ffff142d..6ed378ef 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -40,11 +40,12 @@ Review JSON-LD Resolution When retrieving an entity Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${entity_id} Delete Created Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 1c08596b..680cc1f6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -33,11 +33,13 @@ Query the temporal evolution of entities [Documentation] Check that one can query the temporal evolution of entities [Arguments] ${timerel} ${timeat} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=${timerel} ... timeAt=${timeat} ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -49,17 +51,22 @@ Query the temporal evolution of entities Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} - Set Test Variable ${first_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 Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index 91b5c64d..e9e977f6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -23,12 +23,14 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expe [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... attrs=${temporal_attributes_to_be_retrieved} ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -41,15 +43,17 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expe *** Keywords *** Setup Initial Temporal Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 4d8e3885..c8ddcc82 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -22,12 +22,14 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expe [Documentation] Check that one can query the temporal evolution of the last N instances of entities attributes [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... lastN=${14} ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -41,14 +43,16 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expe *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 57817f32..6f353cf7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -22,11 +22,13 @@ ${expectation_file}= vehicles-temporal-representation-021-04-expe [Documentation] Check that one can query the temporal evolution of entities using a context [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -40,14 +42,16 @@ ${expectation_file}= vehicles-temporal-representation-021-04-expe *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index b9c607ce..d83f3598 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -23,11 +23,13 @@ ${expectation_file}= vehicles-temporal-representation-021-05-expectation. [Documentation] Check that one can query the temporal evolution of entities matching the given type(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements @@ -39,10 +41,16 @@ ${expectation_file}= vehicles-temporal-representation-021-05-expectation. *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${second_temporal_entity_representation_id} + ${create_response1}= Create Temporal Representation Of Entity + ... ${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}= Generate Random Entity Id ${bus_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity + ... ${bus_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 Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 1abc4825..76ee9cb8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -23,12 +23,14 @@ ${expectation_file}= vehicles-temporal-representation-021-06-expe [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_ids=${entity_ids_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements @@ -40,14 +42,16 @@ ${expectation_file}= vehicles-temporal-representation-021-06-expe *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index a937da61..630c7d6e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -22,12 +22,14 @@ ${expectation_file}= vehicles-temporal-representation-021-07-expe [Documentation] Check that one can query the temporal evolution of entities matching the given id pattern [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_id_pattern=urn:ngsi-ld:Vehicle:.* ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -41,14 +43,16 @@ ${expectation_file}= vehicles-temporal-representation-021-07-expe *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 7dec5616..164cfcdf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -22,12 +22,14 @@ ${expectation_file}= vehicles-temporal-representation-021-08-expe [Documentation] Check that one can query the temporal evolution of entities matching the given NGSI-LD query [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... ngsild_query=speed>90 ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} @@ -41,14 +43,16 @@ ${expectation_file}= vehicles-temporal-representation-021-08-expe *** Keywords *** Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 0c2a0f23..179afc14 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -32,6 +32,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query [Documentation] Check that one can query the temporal evolution of entities matching the given NGSI-LD geo-query [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... georel=${georel} @@ -41,6 +42,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements @@ -50,14 +52,16 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Test Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index f373dd13..fab5d565 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -42,19 +42,22 @@ Query the temporal evolution of entities with a limit to the number of entities Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity + 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 ${vehicule_id_prefix} + ${create_response3}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${third_temporal_entity_representation_id} - Set Test Variable ${first_temporal_entity_representation_id} - Set Test Variable ${second_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 diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index 0c8be253..7a84dbf6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -33,7 +33,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity 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 a33e3115..68af1253 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -44,14 +44,16 @@ Query the temporal evolution of entities using the entityOperations method Setup Initial Temporal Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Test Variable ${first_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_temporal_entity_representation_id} Delete Initial Temporal Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot index ed2488f2..434d2f59 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_14.robot @@ -50,19 +50,22 @@ Query the temporal evolution of entities Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity + ${create_response1}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_temporal_entity_representation_id} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity + 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} - Set Test Variable ${first_temporal_entity_representation_id} - Set Test Variable ${second_temporal_entity_representation_id} + Check Response Status Code 201 ${create_response3.status_code} Set Test Variable ${third_temporal_entity_representation_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 5ad471d5..26606fce 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -32,7 +32,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index acdd9fe5..09a5c1f2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -33,7 +33,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 8c75629c..3642e4fc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -35,7 +35,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectati *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 8b01da92..6e540f28 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -46,7 +46,10 @@ Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 9375ae08..a093e132 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -41,7 +41,10 @@ Retrieve the temporal evolution of the last N instances of entity attributes Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 29374deb..512691e2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -34,7 +34,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index 9c4200fb..91780611 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -45,7 +45,10 @@ Retrieve the temporal evolution of an entity with an invalid request content Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index c549ec1d..3804078d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -35,7 +35,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectati *** Keywords *** Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_11.robot index b4c20e90..fe81ed1d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_11.robot @@ -51,7 +51,10 @@ Retrieve the temporal evolution of an entity with the aggregated temporal repres Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot index 8bfa8d24..d995a827 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot @@ -41,7 +41,10 @@ Retrieve Temporal Entity Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + ${create_response}= Create Temporal Representation Of Entity + ... ${vehicle_payload_file} + ... ${temporal_entity_representation_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${temporal_entity_representation_id} Delete Initial Temporal Entity -- GitLab From ede8dde3cd4b80dd8b96a3baa85fa88c56799746 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 6 Jul 2024 08:49:27 +0200 Subject: [PATCH 2/7] Refactoring for Batch Operations --- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 8 ++++---- .../BatchEntities/CreateBatchOfEntities/003_02.robot | 7 +++++-- .../BatchEntities/CreateBatchOfEntities/003_04.robot | 6 ++++-- .../BatchEntities/CreateBatchOfEntities/003_05.robot | 6 ++++-- .../BatchEntities/CreateBatchOfEntities/003_06.robot | 2 ++ .../BatchEntities/CreateBatchOfEntities/003_07.robot | 4 ++++ .../BatchEntities/CreateBatchOfEntities/003_08.robot | 2 ++ .../BatchEntities/CreateBatchOfEntities/003_09.robot | 2 ++ .../BatchEntities/CreateBatchOfEntities/003_10.robot | 2 +- .../BatchEntities/DeleteBatchOfEntities/006_01.robot | 8 +++++--- .../BatchEntities/DeleteBatchOfEntities/006_02.robot | 7 ++++--- .../BatchEntities/DeleteBatchOfEntities/006_04.robot | 5 +++-- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 10 +++++++--- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 10 +++++++--- .../BatchEntities/UpdateBatchOfEntities/005_03.robot | 9 ++++++--- .../BatchEntities/UpsertBatchOfEntities/004_01.robot | 2 ++ .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 6 ++++-- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 10 +++++++--- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 7 +++++-- .../BatchEntities/UpsertBatchOfEntities/004_05.robot | 4 +++- 20 files changed, 81 insertions(+), 36 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index d6b9ac5f..85545c9b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -38,15 +38,15 @@ Batch Create Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Set Test Variable @{expected_entities_ids} + ${response}= Batch Create Entities ... @{entities_to_be_created} - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Set Test Variable @{expected_entities_ids} - ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code 201 ${response.status_code} + ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} - ${response1}= Query Entities ... entity_ids=${entities_to_be_queried} ... entity_types=Building diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index a9362c81..13b39dbc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -27,13 +27,15 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} + ${response}= Batch Create Entities @{entities_to_be_created} + + Check Response Status Code 207 ${response.status_code} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${existing_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} ${response1}= Query Entities @@ -48,7 +50,8 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Keywords *** Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${existing_entity_id} + ${create_response}= Create Entity building-minimal-sample.jsonld ${existing_entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${existing_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index 996b2fd1..3620cfd6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -22,12 +22,13 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id ... id=${entity_id} ... context=${ngsild_test_suite_context} @@ -44,12 +45,13 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id ... id=${entity_id} # Attribute should not be compacted as one did not provide a context containing this attribute diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index a449532b..2e1f63d7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -22,9 +22,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id id=${entity_id} # Attribute should be compacted as one used the same default context as provided when creating the entity Check Response Body Containing an Attribute set to @@ -39,9 +40,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as one did not provide a context containing this term Check Response Body Containing an Attribute set to diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index ca78572c..e8980eaf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -17,7 +17,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index f88f8734..e84b5ba6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -21,7 +21,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id ... id=${entity_id} @@ -38,7 +40,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Set Test Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} ${response1}= Retrieve Entity by Id ... id=${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index b2ed5447..d4eb3ed2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -17,7 +17,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 18e49296..a634b394 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -17,10 +17,12 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_10.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_10.robot index 72ffd6d8..d38303b6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_10.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_10.robot @@ -27,13 +27,13 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${response}= Batch Create Entities @{entities_to_be_created} + Check Response Status Code 207 ${response.status_code} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Set Test Variable @{expected_successful_entities_ids} @{expected_failed_entities_ids}= Create List ${first_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 0858a198..9c488889 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -18,8 +18,8 @@ ${building_id_prefix}= urn:ngsi-ld:Building: [Documentation] Check that one can delete a batch of entities [Tags] be-delete 5_6_10 ${response}= Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} - Check Response Status Code 204 ${response.status_code} + Check Response Status Code 204 ${response.status_code} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} ${response1}= Query Entities ... entity_ids=${expected_entities_ids} @@ -31,8 +31,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response1}= Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Check Response Status Code 201 ${create_response1.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + ${create_response2}= Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + Check Response Status Code 201 ${create_response2.status_code} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} Set Test Variable ${entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index a7a21efb..52ebe3e6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -21,14 +21,14 @@ ${building_id_prefix}= urn:ngsi-ld:Building: @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} ${response}= Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + + Check Response Status Code 207 ${response.status_code} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} Set Test Variable ${expected_successful_entities_ids} - &{response1}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${response1} ${response.json()} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} @@ -42,5 +42,6 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Keywords *** Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} + ${create_response}= Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_04.robot index 6bc4a30d..34d343bb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_04.robot @@ -22,17 +22,18 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${response}= Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Check Response Status Code 207 ${response.status_code} @{expected_successful_entities_ids}= Create List ${entity_id} @{expected_failed_entities_ids}= Create List ${entity_id} &{response1}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${response1} ${response.json()} *** Keywords *** Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${entity_id} + ${create_response}= Create Entity building-simple-attributes-sample.jsonld ${entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 96a32044..eca48d12 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -36,7 +36,9 @@ Batch Update Entity Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} @@ -54,10 +56,12 @@ Batch Update Entity Scenarios Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_entity_id} - Create Entity ${entity_payload_filename} ${second_entity_id} + ${create_response1}= Create Entity ${entity_payload_filename} ${first_entity_id} + Check Response Status Code 201 ${create_response1.status_code} Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response2}= Create Entity ${entity_payload_filename} ${second_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 46ae55f4..0312fe87 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -36,7 +36,9 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code ${expected_status} ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} @@ -54,10 +56,12 @@ Batch Update Entity With NoOverwrite Option Scenarios Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_entity_id} - Create Entity ${entity_payload_filename} ${second_entity_id} + ${create_response1}= Create Entity ${entity_payload_filename} ${first_entity_id} + Check Response Status Code 201 ${create_response1.status_code} Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response2}= Create Entity ${entity_payload_filename} ${second_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 02fe8b83..81bbaba3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -31,6 +31,7 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} ${response}= Batch Update Entities @{entities_to_be_updated} + @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} Set Suite Variable @{expected_successful_entities_ids} @{expected_failed_entities_ids}= Create List ${new_entity_id} @@ -61,10 +62,12 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- *** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_existing_entity_id} - Create Entity ${entity_payload_filename} ${second_existing_entity_id} + ${create_response1}= Create Entity ${entity_payload_filename} ${first_existing_entity_id} + Check Response Status Code 201 ${create_response1.status_code} Set Suite Variable ${first_existing_entity_id} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response2}= Create Entity ${entity_payload_filename} ${second_existing_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Suite Variable ${second_existing_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index f3605ba9..809ee1fc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -35,7 +35,9 @@ Batch Upsert Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Set Test Variable @{expected_entities_ids} Check Response Status Code 201 ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index ca888974..ca99756b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -30,8 +30,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Batch Upsert Non-existing And Existing Entities Scenarios [Documentation] Check that one can upsert a batch of non-existing and existing entities [Arguments] ${filename} - Setup Initial Entities ${filename} + Prepare Entities To Upsert ${filename} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} @@ -47,7 +49,7 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} ${response1.json()} -Setup Initial Entities +Prepare Entities To Upsert [Arguments] ${filename} ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 78c6d316..76410037 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -34,7 +34,9 @@ Batch Upsert Existing Entities Scenarios ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 204 ${response.status_code} @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} @@ -47,10 +49,12 @@ Batch Upsert Existing Entities Scenarios Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} - Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + ${create_response1}= Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} + Check Response Status Code 201 ${create_response1.status_code} Set Test Variable ${first_existing_entity_id} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response2}= Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${second_existing_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 0776bdd7..c96a4ed7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -38,9 +38,11 @@ Batch Upsert Entities With Update Option Scenarios ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update - @{expected_entities_ids}= Create List ${new_entity_id} + Check Response Status Code 201 ${response.status_code} + @{expected_entities_ids}= Create List ${new_entity_id} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -56,7 +58,8 @@ Batch Upsert Entities With Update Option Scenarios Setup Initial Entity ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${existing_entity_payload_filename} ${existing_entity_id} + ${create_response}= Create Entity ${existing_entity_payload_filename} ${existing_entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${existing_entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 9d38256b..936cc776 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -25,14 +25,16 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} ${invalid_entity}= Remove Entity Type ${third_entity} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + + Check Response Status Code 207 ${response.status_code} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Set Test Variable ${expected_successful_entities_ids} @{expected_failed_entities_ids}= Create List ${third_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... success=${expected_successful_entities_ids} ... errors=${expected_failed_entities_ids} - Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} ${response1}= Query Entities -- GitLab From 37c81af149c12497089581aac972e60d377a8849 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 6 Jul 2024 15:44:32 +0200 Subject: [PATCH 3/7] refactoring for other ContextInformation/Provision operations --- .../Entities/CreateEntity/001_03.robot | 18 +++++++++------ .../Entities/CreateEntity/001_10.robot | 2 ++ .../Entities/CreateEntity/001_11.robot | 2 ++ .../Entities/DeleteEntity/002_01.robot | 15 +++++++++---- .../AppendEntityAttributes/010_04.robot | 2 +- .../DeleteEntityAttribute/013_01.robot | 18 +++++++++------ .../007_01.robot | 2 ++ .../008_01.robot | 18 +++++++++------ .../AddAttributes/014_01.robot | 18 +++++++++------ .../AddAttributes/014_02.robot | 13 ++++++++--- .../AddAttributes/014_03.robot | 14 ------------ .../AddAttributes/014_04.robot | 5 ++++- .../DeleteAttribute/015_01.robot | 1 + .../DeleteAttributeInstance/017_01.robot | 19 ++++++++++------ .../DeleteAttributeInstance/017_03.robot | 4 ++-- .../016_01.robot | 22 ++++++++++--------- .../016_03.robot | 4 ++-- 17 files changed, 105 insertions(+), 72 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index a87fc5f2..bd66de0d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entity Suite Teardown Delete Initial Entity @@ -18,17 +19,11 @@ ${content_type}= application/ld+json 001_03_01 Create one valid entity and one invalid entity [Documentation] Check that one cannot create an entity with an existing id [Tags] e-create 5_6_1 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type - ... ${filename} - ... ${entity_id} - ... ${content_type} - Check Response Status Code 201 ${response.status_code} ${response1}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} + Check Response Status Code 409 ${response1.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response1.json()} @@ -37,5 +32,14 @@ ${content_type}= application/ld+json *** Keywords *** +Setup Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} + Check Response Status Code 201 ${response.status_code} + Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot index a73e3b8a..6948bf84 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot @@ -26,10 +26,12 @@ Create Entity Scenarios [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} + Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${entity_id} ${response.headers} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_11.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_11.robot index d527be3d..b6341b02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_11.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_11.robot @@ -29,10 +29,12 @@ Create Entity Scenarios [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} + Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${entity_id} ${response.headers} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 8705306c..589d6472 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -6,6 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Setup Initial Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -15,13 +17,18 @@ ${building_id_prefix}= urn:ngsi-ld:Building: 002_01_01 Delete an entity [Documentation] Check that one can delete an entity by id [Tags] e-delete 5_6_6 + ${response1}= Delete Entity by Id ${entity_id} + Check Response Status Code 204 ${response1.status_code} + ${response2}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource ${response2.status_code} + + +*** Keywords *** +Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Create Entity Selecting Content Type ... building-simple-attributes-sample.jsonld ... ${entity_id} ... application/ld+json Check Response Status Code 201 ${response.status_code} - ${response1}= Delete Entity by Id ${entity_id} - Check Response Status Code 204 ${response1.status_code} - ${response2}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource ${response2.status_code} + Set Test Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot index 17b358e7..9186b2df 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot @@ -53,7 +53,7 @@ Create Initial Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - Set Global Variable ${entity_id} + Set Test Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index bc2b343a..eee8857f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Setup Initial Entity Test Teardown Delete Initial Entities Test Template Delete Attributes @@ -31,19 +32,13 @@ Delete Attributes [Documentation] Check that one can delete an attribute from an entity [Tags] ea-delete 5_6_5 [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test 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} ${response}= Delete Entity Attributes ... entityId=${entity_id} ... attributeId=${attribute_id} ... datasetId=${datasetId} ... deleteAll=${deleteAll} ... context=${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} ${response2}= Retrieve Entity by Id @@ -56,5 +51,14 @@ Delete Attributes ... response_body=${response2.json()} ... ignored_keys=${ignored_attributes} +Setup Initial Entity + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test 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 Initial Entities Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 6f17ab1e..213ceee0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -28,10 +28,12 @@ Create Temporal Entity [Arguments] ${filename} ${expectation_filename} ${content_type} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Test Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... temporal_entity_representation_id=${temporal_entity_representation_id} ... filename=${filename} ... content_type=${content_type} + Check Response Status Code 201 ${response.status_code} ${created_temporal_entity}= Load Test Sample ... temporalEntities/${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index fe1d96f7..1b1c7d9c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Temporal Entity Suite Teardown Delete Temporal Entity @@ -20,17 +21,11 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j 008_01_01 Update a temporal representation of an entity with simple temporal properties [Documentation] Check that one can update a temporal representation of an entity with simple temporal properties [Tags] te-update 5_6_11 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... filename=${filename} - ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} ${response1}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... temporal_entity_representation_id=${temporal_entity_representation_id} ... filename=${update_filename} ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response1.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} @@ -47,5 +42,14 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j *** Keywords *** +Create Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot index 0a219652..0e550d27 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Temporal Entity Suite Teardown Delete Temporal Entity @@ -20,17 +21,11 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe 014_01_01 Add an attribute to a temporal entity with simple temporal properties [Documentation] Check that one can add a simple temporal attribute to a temporal representation of an entity [Tags] tea-append 5_6_12 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... filename=${filename} - ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response.status_code} ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} @@ -47,5 +42,14 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe *** Keywords *** +Create Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot index bd73ea21..d522cb21 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Create Temporal Entity +Test Teardown Delete Temporal Entity Test Template Add Attribute To Temporal Entity @@ -27,12 +29,17 @@ Add Attribute To Temporal Entity [Documentation] Check that an error is raised if one adds a temporal entity attribute with a non-existing/invalid EntityId [Tags] tea-append 5_6_12 [Arguments] ${id} + ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... temporal_entity_representation_id=${temporal_entity_representation_id} ... filename=${filename} ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response.status_code} - ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot index f667654f..dfca906b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_03.robot @@ -5,8 +5,6 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProv Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Teardown Delete Temporal Entity - *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -19,21 +17,9 @@ ${status_code}= 404 014_03_01 Add Attribute To Temporal Entity [Documentation] Check that an error is raised if one adds an attribute to a non-existent entity [Tags] tea-append 5_6_12 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... filename=${filename} - ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response.status_code} ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Attribute To Temporal Entity ... ${not_found_temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} - - -*** Keywords *** -Delete Temporal Entity - Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot index d525d4c6..59e2245a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_04.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Initialize Test Case +Test Teardown Delete Temporal Entity Test Template Add an Attribute To a Temporal Entity From File @@ -35,7 +36,6 @@ Add an Attribute To a Temporal Entity From File Check Response Status Code ${status_code} ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Initialize Test Case ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -45,3 +45,6 @@ Initialize Test Case ... filename=${filename} ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index e2da4a97..8f868ef9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -39,6 +39,7 @@ Delete Attribute From A Temporal Entity ... datasetId=${datasetid} ... deleteAll=${deleteall} ... context=${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 252acc57..25161e5a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Temporal Entity Suite Teardown Delete Temporal Entity @@ -20,24 +21,19 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc 017_01_01 Delete an attribute instance in temporal representation of an entity [Documentation] Check that one can delete an attribute instance in temporal representation of an entity [Tags] tea-instance-delete 5_6_15 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... filename=${filename} - ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${create_response.status_code} ${retrieve_response}= Retrieve Temporal Representation Of Entity ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId}= Set Variable ${retrieve_response.json()['speed'][0]['instanceId']} + ${response}= Delete Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} ... ${attributeId} ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} @@ -54,5 +50,14 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc *** Keywords *** +Create Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${create_response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 0f7bd6bc..97b94491 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -47,8 +47,6 @@ Create Id ... filename=${filename} ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${unknown_temporal_entity_id} ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... accept=${CONTENT_TYPE_LD_JSON} @@ -56,6 +54,8 @@ Create Id ... context=${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Test Variable ${valid_instanceId} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${unknown_temporal_entity_id} Delete Initial Temporal Representation Of Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index d968821a..d6366c1c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationCons Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Temporal Entity Suite Teardown Delete Intitial Temporal Representation Of Entity @@ -21,15 +22,6 @@ ${attributeId}= speed 016_01_01 Modify attribute instance in temporal representation of an entity [Documentation] Check that one can partially update an attribute instance of a temporal representation of an entity [Tags] tea-partial-update 5_6_14 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type - ... temporal_entity_representation_id=${temporal_entity_representation_id} - ... filename=${filename} - ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} - ${response1}= Retrieve Temporal Representation Of Entity ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} @@ -43,8 +35,8 @@ ${attributeId}= speed ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 204 ${response2.status_code} + Check Response Status Code 204 ${response2.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} @@ -67,5 +59,15 @@ ${attributeId}= speed *** Keywords *** +Create Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... filename=${filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Delete Intitial Temporal Representation Of Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index 47a08510..10d73b83 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -49,8 +49,6 @@ Create Id ... filename=${filename} ... content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${unknown_temporal_entity_id} ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... accept=${CONTENT_TYPE_LD_JSON} @@ -58,6 +56,8 @@ Create Id ... context=${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Test Variable ${valid_instanceId} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${unknown_temporal_entity_id} Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} -- GitLab From 77d16d42f2ca1ac2d8a0ba052352de5335cbe10f Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 12 Jul 2024 16:30:51 +0200 Subject: [PATCH 4/7] refactoring for other ContextInformation/Subscription operations --- .../CreateSubscription/028_04.robot | 17 +++++---- .../DeleteSubscription/032_03.robot | 6 +++- .../QuerySubscriptions/031_01.robot | 17 +++++---- .../QuerySubscriptions/031_02.robot | 17 +++++---- .../RetrieveSubscription/030_03.robot | 6 +++- .../046_01.robot | 15 ++++---- .../046_02.robot | 8 +++-- .../046_03.robot | 10 ++++-- .../046_04.robot | 10 ++++-- .../046_05.robot | 10 ++++-- .../046_06.robot | 5 ++- .../046_07.robot | 8 +++-- .../046_08.robot | 8 +++-- .../046_09.robot | 11 +++--- .../046_10.robot | 11 +++--- .../046_11.robot | 15 ++++---- .../046_12.robot | 35 ++++++++++--------- .../046_13.robot | 29 ++++++++------- .../046_14.robot | 35 ++++++++++--------- .../046_15.robot | 10 ++++-- .../046_16_01.robot | 5 ++- .../046_16_02.robot | 5 ++- .../UpdateSubscription/029_03.robot | 6 +++- .../UpdateSubscription/029_04.robot | 6 +++- .../UpdateSubscription/029_05.robot | 6 +++- .../UpdateSubscription/029_06.robot | 6 +++- .../UpdateSubscription/029_07.robot | 6 +++- .../UpdateSubscription/029_08.robot | 6 +++- .../UpdateSubscription/029_09.robot | 6 +++- .../UpdateSubscription/029_10.robot | 6 +++- .../UpdateSubscription/029_11.robot | 6 +++- resources/AssertionUtils.resource | 2 +- 32 files changed, 232 insertions(+), 117 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index f5b0dd6f..ee7a99dd 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Initial Subscription Suite Teardown Delete Initial Subscriptions @@ -17,16 +18,11 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld 028_04_01 Create a subscription with an id known to the system [Documentation] Check that one cannot create a subscription with an existing id [Tags] sub-create 5_8_1 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} - ${initial_response}= Create Subscription - ... ${subscription_id} - ... ${subscription_payload_file_path} - ... ${CONTENT_TYPE_LD_JSON} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} @@ -35,5 +31,14 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Keywords *** +Create Initial Subscription + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} + Delete Initial Subscriptions Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 5747e0b5..abee53d5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -27,5 +27,9 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index d504b783..bb64269b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -36,22 +36,25 @@ ${expectation_file_path}= subscriptions/expectations/subsc *** Keywords *** Setup Initial Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription + ${create_response1}= Create Subscription ... ${first_subscription_id} ... ${first_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Create Subscription + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${first_subscription_id} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${create_response2}= Create Subscription ... ${second_subscription_id} ... ${second_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Create Subscription + Check Response Status Code 201 ${create_response2.status_code} + Set Suite Variable ${second_subscription_id} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${create_response3}= Create Subscription ... ${third_subscription_id} ... ${third_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} + Check Response Status Code 201 ${create_response3.status_code} Set Suite Variable ${third_subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index c3ca806b..2d5995b0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -47,22 +47,25 @@ Query Subscriptions With Limit And Page Parameters Setup Initial Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription + ${create_response1}= Create Subscription ... ${first_subscription_id} ... ${first_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Create Subscription + Check Response Status Code 201 ${create_response1.status_code} + Set Test Variable ${first_subscription_id} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${create_response2}= Create Subscription ... ${second_subscription_id} ... ${second_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Create Subscription + Check Response Status Code 201 ${create_response2.status_code} + Set Test Variable ${second_subscription_id} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${create_response3}= Create Subscription ... ${third_subscription_id} ... ${third_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Set Test Variable ${first_subscription_id} - Set Test Variable ${second_subscription_id} + Check Response Status Code 201 ${create_response3.status_code} Set Test Variable ${third_subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index cfc21f76..b365e370 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -32,7 +32,11 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot index aebf2830..12f6fcfd 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_01.robot @@ -25,10 +25,6 @@ ${notification_server_send_url}= http://${notification_server_host}:${not [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_8_6 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} @@ -41,10 +37,14 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions Add Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Setup Initial Subscriptions @@ -54,7 +54,10 @@ Setup Initial Subscriptions ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot index 9fb9e494..69cc5e9b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_02.robot @@ -53,9 +53,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot index b8cb874b..46cd9bca 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot @@ -24,7 +24,6 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_03_01 Check that a notification is sent with all entities [Documentation] A notification with all subscribed Entities will be included if query or geoquery are not defined. [Tags] sub-notification 5_8_6 - ${response}= Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -41,6 +40,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -53,9 +53,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot index 3e487caf..09475d2b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot @@ -24,7 +24,6 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_04_01 Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions [Tags] sub-notification 5_8_6 - ${response}= Setup Initial Subscriptions ${response1}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -40,6 +39,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -51,9 +51,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot index b698a8c2..c94b1e8d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_05.robot @@ -24,7 +24,6 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_05_01 Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions [Tags] sub-notification 5_8_6 - Setup Initial Subscriptions ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -41,6 +40,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -53,9 +53,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot index 021d8432..f98d8714 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_06.robot @@ -46,7 +46,10 @@ Setup Server And Subscriptions Set Suite Variable ${subscription_id} Start Local Server ${notification_server_host} ${notification_server_port} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Sleep 1s Delete Server And Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot index cbba2962..549c4211 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_07.robot @@ -85,9 +85,13 @@ Setup Initial Subscriptions Set Test Variable ${entity_id} Set Test Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot index 3e685e62..35fbe3b2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_08.robot @@ -81,9 +81,13 @@ Setup Initial Subscriptions Set Test Variable ${entity_id} Set Test Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot index 359b126c..72a5d949 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_09.robot @@ -25,8 +25,6 @@ ${notification_server_send_url} http://${notification_server_host}:${not [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.receiverInfo defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.1 [Tags] sub-notification 5_8_6 - Setup Initial Subscriptions - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} @@ -36,6 +34,7 @@ ${notification_server_send_url} http://${notification_server_host}:${not *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -48,9 +47,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot index 31866d31..9f61ff5d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_10.robot @@ -26,8 +26,6 @@ ${expected_header_links} <${ngsild_test_suite_context}>; rel="htt [Documentation] The Notification shall be sent as JSON [Tags] sub-notification 5_8_6 - Setup Initial Subscriptions - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} @@ -39,6 +37,7 @@ ${expected_header_links} <${ngsild_test_suite_context}>; rel="htt *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -51,9 +50,13 @@ Setup Initial Subscriptions Set Suite Variable ${subscription_id} Set Suite Variable ${entity_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot index f8b2d391..bab90df1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_11.robot @@ -27,10 +27,6 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ [Documentation] The notification.timesSent member shall be incremented by one. [Tags] sub-notification 5_8_6 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for notification timeout=${10} @@ -47,6 +43,9 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -55,12 +54,16 @@ Setup Initial Subscriptions ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Add Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot index bacdb570..42eaae30 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_12.robot @@ -25,10 +25,6 @@ ${notification_server_send_url}= http://${notification_server_host}:${not [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. [Tags] sub-notification 5_8_6 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for notification timeout=${10} @@ -53,6 +49,18 @@ ${notification_server_send_url}= http://${notification_server_host}:${not *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} + Set Suite Variable ${entity_id} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -60,24 +68,19 @@ Setup Initial Subscriptions ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} - After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - Delete Initial Entity Delete Entity by Id ${entity_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot index ccc6ef86..336ac77e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_13.robot @@ -46,26 +46,31 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** +Before Test + Setup Initial Subscription + Add Initial Entity + Setup Initial Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} -Delete Initial Subscription - Delete Subscription ${subscription_id} - Add Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} -Delete Initial Entity - Delete Entity by Id ${entity_id} - -Before Test - Setup Initial Subscription - Add Initial Entity - After Test Delete Initial Subscription Delete Initial Entity + +Delete Initial Subscription + Delete Subscription ${subscription_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot index b5258eb6..31d75153 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_14.robot @@ -25,11 +25,6 @@ ${notification_server_send_url} http://${notification_server_host}:${not [Documentation] The Notification content shall be JSON-LD when endpoint.accept is set to 'application/ld+json' [Tags] sub-notification 5_8_6 - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Sleep 1s - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait For Notification timeout=${10} @@ -46,6 +41,19 @@ ${notification_server_send_url} http://${notification_server_host}:${not *** Keywords *** +Before Test + Start Local Server ${notification_server_host} ${notification_server_port} + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + Sleep 1s + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response.status_code} + Set Suite Variable ${entity_id} + Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint @@ -53,24 +61,19 @@ Setup Initial Subscriptions ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - Start Local Server ${notification_server_host} ${notification_server_port} - After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot index c1661f98..a04c3fc9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_15.robot @@ -24,7 +24,6 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld 046_15_01 Check that a notification is not sent if the throttling has not elapsed yet [Documentation] If a Subscription defines a throttling member, a Notification shall not be sent if the throttling specified (in seconds) has not elapsed yet. [Tags] sub-notification 5_8_6 - Setup Initial Subscriptions ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -38,6 +37,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} + Setup Initial Subscriptions Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -50,9 +50,13 @@ Setup Initial Subscriptions Set Suite Variable ${entity_id} Set Suite Variable ${subscription_id} - Create Entity ${entity_building_filepath} ${entity_id} + ${create_response1}= Create Entity ${entity_building_filepath} ${entity_id} + Check Response Status Code 201 ${create_response1.status_code} Sleep 1s - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response2}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} Sleep 1s After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_01.robot index 1fc0f388..ef421c35 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_01.robot @@ -47,7 +47,10 @@ Setup Initial Subscription ... ${subscription_payload_file_path} ... ${subscription_id} ... ${notification_server_send_url} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Before Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_02.robot index b07e3496..25a8cfcc 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_16_02.robot @@ -42,7 +42,10 @@ Setup Initial Subscription ... ${subscription_payload_file_path} ... ${subscription_id} ... ${notification_server_send_url} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Before Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index f21ab5f0..5d6edc22 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -33,7 +33,11 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index 2d8d7a0e..2459501e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -33,7 +33,11 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 9bc578ad..a2256913 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -55,7 +55,11 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 6eb12e05..060dbcfa 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -42,7 +42,11 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Set Suite Variable ${subscription_payload} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index a465f452..525501e6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -39,7 +39,11 @@ Activate Paused Subscription With isActive Member Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index 2535a2b5..dc3c381a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -39,7 +39,11 @@ Activate Paused Subscription With isActive And ExpiresAt Members Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 11d68bd4..1b44edff 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -35,7 +35,11 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 3f666970..5192a8e5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -46,7 +46,11 @@ ${subscription_update_fragment_file_path} subscriptions/fragments/subscrip *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index f2c348a7..ec00bf80 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -33,7 +33,11 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${initial_response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${initial_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Subscriptions diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 432e6ce7..1599de12 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -43,7 +43,7 @@ Check Response Body Containing Entities URIS set to Append To List ${response_entities_ids} ${entity['id']} END - Lists Should Be Equal ${expected_entities_ids} ${response_entities_ids} ignore_order=True + Lists Should Be Equal ${expected_entities_ids} ${response_entities_ids} ignore_order=True Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} -- GitLab From 547e1df1a51a5ed67940e9781668f0f6ad64f9c9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 12 Jul 2024 17:24:34 +0200 Subject: [PATCH 5/7] fix: lost variable --- .../QueryTemporalEvolutionOfEntities/021_02.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index e9e977f6..74459370 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -43,13 +43,13 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expe *** Keywords *** Setup Initial Temporal Entities - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${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} - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${create_response2}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} -- GitLab From 4473581dc64b5bbb2e08a15021f3bdba8783b020 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 13 Jul 2024 18:42:58 +0200 Subject: [PATCH 6/7] fix: misc fixes for generation of the documentation --- .../Provision/Entities/CreateEntity/001_03.robot | 12 ++++++------ .../Provision/Entities/DeleteEntity/002_01.robot | 4 ++-- .../AppendEntityAttributes/010_06.robot | 4 ++-- .../008_01.robot | 4 ++-- .../PartialUpdateAttributeInstance/016_01.robot | 4 ++-- .../SubscriptionNotificationBehaviour/046_03.robot | 2 +- .../SubscriptionNotificationBehaviour/046_04.robot | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index bd66de0d..d78c44d2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -19,27 +19,27 @@ ${content_type}= application/ld+json 001_03_01 Create one valid entity and one invalid entity [Documentation] Check that one cannot create an entity with an existing id [Tags] e-create 5_6_1 - ${response1}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 409 ${response1.status_code} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response1.json()} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response1.json()} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} *** Keywords *** Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 589d6472..bc5210dd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -17,8 +17,8 @@ ${building_id_prefix}= urn:ngsi-ld:Building: 002_01_01 Delete an entity [Documentation] Check that one can delete an entity by id [Tags] e-delete 5_6_6 - ${response1}= Delete Entity by Id ${entity_id} - Check Response Status Code 204 ${response1.status_code} + ${response}= Delete Entity by Id ${entity_id} + Check Response Status Code 204 ${response.status_code} ${response2}= Retrieve Entity by Id id=${entity_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource ${response2.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot index b4e68831..99a5f908 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot @@ -37,11 +37,11 @@ Append Attributes Without Params Create Initial Entity ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Entity Selecting Content Type + ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response.status_code} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 1b1c7d9c..0880d6b5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -21,12 +21,12 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j 008_01_01 Update a temporal representation of an entity with simple temporal properties [Documentation] Check that one can update a temporal representation of an entity with simple temporal properties [Tags] te-update 5_6_11 - ${response1}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... temporal_entity_representation_id=${temporal_entity_representation_id} ... filename=${update_filename} ... content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response1.status_code} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index d6366c1c..1e9461fc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -22,11 +22,11 @@ ${attributeId}= speed 016_01_01 Modify attribute instance in temporal representation of an entity [Documentation] Check that one can partially update an attribute instance of a temporal representation of an entity [Tags] tea-partial-update 5_6_14 - ${response1}= Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... temporal_entity_representation_id=${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_before_update}= Set Variable ${response1.json()['speed'][0]['instanceId']} + ${instanceId_before_update}= Set Variable ${response.json()['speed'][0]['instanceId']} ${response2}= Modify Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot index 46cd9bca..4e934ff7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_03.robot @@ -25,7 +25,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld [Documentation] A notification with all subscribed Entities will be included if query or geoquery are not defined. [Tags] sub-notification 5_8_6 - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} Should be Equal ${subscription_id} ${notification}[subscriptionId] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot index 09475d2b..75939377 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_04.robot @@ -25,7 +25,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions [Tags] sub-notification 5_8_6 - ${response1}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification ${5} Should be Equal ${subscription_id} ${notification}[subscriptionId] -- GitLab From 0cd5443d6f10f9e109feceb8017838acbbc60843 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 14 Jul 2024 06:56:03 +0200 Subject: [PATCH 7/7] refactoring for ContextSource operations --- .../037_01.robot | 6 +++-- .../037_04.robot | 3 ++- .../037_05.robot | 19 ++++++++++----- .../037_06.robot | 3 ++- .../037_07.robot | 3 ++- .../037_08.robot | 3 ++- .../037_09.robot | 20 +++++++++++----- .../037_10.robot | 9 +++++--- .../037_11.robot | 9 +++++--- .../036_03.robot | 3 ++- .../036_04.robot | 3 ++- .../036_05.robot | 3 ++- .../035_01.robot | 23 +++++++++++++++---- .../047_01.robot | 3 ++- .../047_02.robot | 6 +++-- .../047_03.robot | 3 ++- .../047_04.robot | 3 ++- .../047_05.robot | 3 ++- .../047_06.robot | 3 ++- .../047_07.robot | 3 ++- .../047_08.robot | 6 +++-- .../047_09.robot | 6 +++-- .../047_10.robot | 3 ++- .../047_11.robot | 2 ++ .../047_12.robot | 3 ++- .../047_13.robot | 3 ++- .../047_14.robot | 3 ++- .../047_15.robot | 3 ++- .../047_16.robot | 9 +++++--- .../038_07.robot | 3 ++- .../042_01.robot | 3 ++- .../041_01.robot | 6 +++-- .../041_02.robot | 9 +++++--- .../041_03.robot | 9 +++++--- .../040_01.robot | 3 ++- .../039_01.robot | 3 ++- .../039_04.robot | 3 ++- 37 files changed, 143 insertions(+), 65 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot index 127e8d0d..3ef177fd 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_01.robot @@ -52,8 +52,10 @@ Setup Initial Context Source Registrations ${second_context_source_registration_payload}= Load Test Sample ... ${second_context_source_registration_payload_file_path} ... ${second_context_source_registration_id} - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} + ${create_response1}= Create Context Source Registration ${first_context_source_registration_payload} + Check Response Status Code 201 ${create_response1.status_code} + ${create_response2}= Create Context Source Registration ${second_context_source_registration_payload} + Check Response Status Code 201 ${create_response2.status_code} Set Test Variable ${first_context_source_registration_id} Set Test Variable ${second_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_04.robot index ae46d96f..67ad6c29 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_04.robot @@ -36,7 +36,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot index 41350779..452528f0 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_05.robot @@ -27,16 +27,13 @@ ${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistr Query Context Source Registration Matching EntityInfo of RegistrationInfo [Documentation] Check that one can query context source registrations matching EntityInfo of RegistrationInfo [Arguments] ${registration_file_path} ${expectation_file_path} - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample - ... ${registration_file_path} - ... ${context_source_registration_id} - ${create_response}= Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} + Setup Initial Context Source Registrations ${registration_file_path} + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=OffStreetParking ... idPattern=.*downtown$ + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements @@ -44,5 +41,15 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo ... ${expected_context_source_registration_ids} ... ${response.json()} +Setup Initial Context Source Registrations + [Arguments] ${registration_file_path} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample + ... ${registration_file_path} + ... ${context_source_registration_id} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} + Set Suite Variable ${context_source_registration_id} + Delete Created Context Source Registration Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_06.robot index bbfb96a5..c2b927d7 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_06.robot @@ -45,7 +45,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot index 36c4ed73..3e695829 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot @@ -49,7 +49,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot index 5b3d80dc..0209b0e0 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_08.robot @@ -35,7 +35,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot index b7fc4a6c..2d38c69e 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_09.robot @@ -37,18 +37,16 @@ ${management_interval_expectation_file_path}= csou Query Context Source Registration Matching Temporal Query [Documentation] Check that one can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample - ... ${payload_file_path} - ... ${context_source_registration_id} - ${create_response}= Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} + + Setup Initial Context Source Registrations ${payload_file_path} + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... timeproperty=${timeproperty} ... timerel=before ... timeAt=2021-08-01T22:00:00Z + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements @@ -56,5 +54,15 @@ Query Context Source Registration Matching Temporal Query ... ${expected_context_source_registration_ids} ... ${response.json()} +Setup Initial Context Source Registrations + [Arguments] ${payload_file_path} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample + ... ${payload_file_path} + ... ${context_source_registration_id} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} + Set Suite Variable ${context_source_registration_id} + Delete Created Context Source Registrations Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot index b11664f4..1472e9bb 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot @@ -57,9 +57,12 @@ Setup Initial Context Source Registrations ${third_context_source_registration_payload}= Load Test Sample ... ${third_context_source_registration_payload_file_path} ... ${third_context_source_registration_id} - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - Create Context Source Registration ${third_context_source_registration_payload} + ${create_response1}= Create Context Source Registration ${first_context_source_registration_payload} + Check Response Status Code 201 ${create_response1.status_code} + ${create_response2}= Create Context Source Registration ${second_context_source_registration_payload} + Check Response Status Code 201 ${create_response2.status_code} + ${create_response3}= Create Context Source Registration ${third_context_source_registration_payload} + Check Response Status Code 201 ${create_response3.status_code} Set Test Variable ${first_context_source_registration_id} Set Test Variable ${second_context_source_registration_id} Set Test Variable ${third_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot index f6825c2f..a69bd870 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot @@ -59,9 +59,12 @@ Setup Initial Context Source Registrations ${third_context_source_registration_payload}= Load Test Sample ... ${third_context_source_registration_payload_file_path} ... ${third_context_source_registration_id} - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - Create Context Source Registration ${third_context_source_registration_payload} + ${create_response1}= Create Context Source Registration ${first_context_source_registration_payload} + Check Response Status Code 201 ${create_response1.status_code} + ${create_response2}= Create Context Source Registration ${second_context_source_registration_payload} + Check Response Status Code 201 ${create_response2.status_code} + ${create_response3}= Create Context Source Registration ${third_context_source_registration_payload} + Check Response Status Code 201 ${create_response3.status_code} Set Test Variable ${first_context_source_registration_id} Set Test Variable ${second_context_source_registration_id} Set Test Variable ${third_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot index 370ad599..568e712b 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_03.robot @@ -35,7 +35,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot index f01cb838..e79e73e9 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_04.robot @@ -36,7 +36,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot index 4a0d3d3f..653ca1c3 100644 --- a/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceRegistration/036_05.robot @@ -45,7 +45,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 70138310..cc8b4ec9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -6,6 +6,9 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Setup Setup Initial Context Source Registrations +Test Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,14 +19,24 @@ ${registration_payload_file_path}= context-source-registration-sample.jsonl 035_01_01 Delete a context source registration by id [Documentation] Check that one can delete a context source registration by id [Tags] csr-delete 5_9_4 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} - ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${create_response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${create_response.status_code} + ${response}= Delete Context Source Registration With Return ${registration_id} + Check Response Status Code 204 ${response.status_code} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource ${response1.status_code} + + +*** Keywords *** +Setup Initial Context Source Registrations + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${create_response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${create_response.status_code} + Set Test Variable ${registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot index 2162618c..e94e8425 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_01.robot @@ -39,7 +39,8 @@ Setup Initial Context Source Registration ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot index 0c53e859..1f71e361 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot @@ -44,12 +44,14 @@ Create Initial Context Source Registration and Context Source Registration Subsc ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${create_csr_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_csr_response.status_code} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - ${response}= Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Set Suite Variable ${expected_context_source_registration_ids} Wait for notification and validate it diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot index 0b16106d..cbb9dd06 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot @@ -44,7 +44,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot index 6584958c..a8669618 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot index dd559ba8..8d235f30 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot @@ -46,7 +46,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot index 36875da4..7905417f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_06.robot @@ -44,7 +44,8 @@ Setup Initial Context Source Registration Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot index 7f51c728..e7b13197 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot @@ -51,7 +51,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot index bddc4ffa..b1c1cbfd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_08.robot @@ -43,8 +43,10 @@ Create Initial Context Source Registration and Context Source Registration Subsc ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration ${context_source_registration_payload} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csr_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_csr_response.status_code} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${context_source_registration_id} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot index 30de1c0b..e525e9ee 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_09.robot @@ -43,8 +43,10 @@ Create Initial Context Source Registration And Context Source Registration Subsc ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration ${context_source_registration_payload} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csr_response}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${create_csr_response.status_code} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${context_source_registration_id} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot index edb70308..d7d0bece 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_10.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot index 52cbf11f..ddc53ca4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_11.robot @@ -34,12 +34,14 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem Set Suite Variable ${subscription_id} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} Set Suite Variable ${context_source_registration_id} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} ${response1}= Create Context Source Registration ${context_source_registration_payload} + Check Response Status Code 201 ${response1.status_code} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... expected_subscription_id=${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot index 59d620a2..9d8db6c9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_12.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot index 5a24fab7..515be442 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_13.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot index 3ab8c258..532e5def 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_14.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot index 792bc9cd..7413bb8f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_15.robot @@ -42,7 +42,8 @@ Setup Initial Context Source Registration Subscription ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration And Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot index 1b8c0878..541c8c26 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_16.robot @@ -59,9 +59,12 @@ Create Initial Context Source Registrations And Context Source Registration Subs ${second_context_source_registration_payload}= Load Test Sample ... ${second_context_source_registration_payload_file_path} ... ${second_context_source_registration_id} - Create Context Source Registration Subscription ${subscription_payload} - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} + ${create_csr_response1}= Create Context Source Registration ${first_context_source_registration_payload} + Check Response Status Code 201 ${create_csr_response1.status_code} + ${create_csr_response2}= Create Context Source Registration ${second_context_source_registration_payload} + Check Response Status Code 201 ${create_csr_response2.status_code} Set Test Variable ${subscription_id} Set Test Variable ${first_context_source_registration_id} Set Test Variable ${second_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index d45c12ef..32f82eef 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -30,7 +30,8 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 2fa66e39..1a4ba225 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -29,5 +29,6 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index fd181bac..07f1e7ea 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -39,8 +39,10 @@ Setup Initial Context Source Registration Subscriptions ${second_subscription_payload}= Load Test Sample ... ${second_subscription_payload_file_path} ... ${second_subscription_id} - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} + ${create_csrsub1_response}= Create Context Source Registration Subscription ${first_subscription_payload} + Check Response Status Code 201 ${create_csrsub1_response.status_code} + ${create_csrsub2_response}= Create Context Source Registration Subscription ${second_subscription_payload} + Check Response Status Code 201 ${create_csrsub2_response.status_code} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 9ee802d7..8c92178c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -56,9 +56,12 @@ Setup Initial Context Source Registration Subscriptions ${third_subscription_payload}= Load Test Sample ... ${third_subscription_payload_file_path} ... ${third_subscription_id} - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} - Create Context Source Registration Subscription ${third_subscription_payload} + ${create_csrsub1_response}= Create Context Source Registration Subscription ${first_subscription_payload} + Check Response Status Code 201 ${create_csrsub1_response.status_code} + ${create_csrsub2_response}= Create Context Source Registration Subscription ${second_subscription_payload} + Check Response Status Code 201 ${create_csrsub2_response.status_code} + ${create_csrsub3_response}= Create Context Source Registration Subscription ${third_subscription_payload} + Check Response Status Code 201 ${create_csrsub3_response.status_code} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} Set Test Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index bb1db3d5..b8b75e79 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -57,9 +57,12 @@ Setup Initial Context Source Registration Subscriptions ${third_subscription_payload}= Load Test Sample ... ${third_subscription_payload_file_path} ... ${third_subscription_id} - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} - Create Context Source Registration Subscription ${third_subscription_payload} + ${create_csrsub1_response}= Create Context Source Registration Subscription ${first_subscription_payload} + Check Response Status Code 201 ${create_csrsub1_response.status_code} + ${create_csrsub2_response}= Create Context Source Registration Subscription ${second_subscription_payload} + Check Response Status Code 201 ${create_csrsub2_response.status_code} + ${create_csrsub3_response}= Create Context Source Registration Subscription ${third_subscription_payload} + Check Response Status Code 201 ${create_csrsub3_response.status_code} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} Set Suite Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index fd4f0e45..b5926844 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -63,7 +63,8 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index abef36c7..3f56e955 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -41,7 +41,8 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Suite Variable ${subscription_id} Set Suite Variable ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index a6b513e4..f938efa3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -40,7 +40,8 @@ Update Context Source Registration Subscription With Invalid Fragment Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - ${response}= Create Context Source Registration Subscription ${subscription_payload} + ${create_csrsub_response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${create_csrsub_response.status_code} Set Test Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions -- GitLab