From c14b3b87da2dad01824acdb71df1aa69733489a2 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 6 May 2023 09:35:45 +0200 Subject: [PATCH 1/6] chore: run Robotidy on all TCs and resources files --- TP/NGSI-LD/CommonBehaviours/043.robot | 57 +- TP/NGSI-LD/CommonBehaviours/044_01.robot | 45 +- TP/NGSI-LD/CommonBehaviours/044_02.robot | 58 +- TP/NGSI-LD/CommonBehaviours/044_03.robot | 58 +- TP/NGSI-LD/CommonBehaviours/044_04.robot | 38 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 27 +- .../027_01_01.robot | 39 +- .../027_01_02.robot | 37 +- .../RetrieveAvailableAttributes/025_01.robot | 46 +- .../024_01_01.robot | 45 +- .../024_01_02.robot | 43 +- .../RetrieveAvailableEntityTypes/022_01.robot | 56 +- .../026_01.robot | 46 +- .../023_01.robot | 56 +- .../Entity/QueryEntities/019_01_01.robot | 44 +- .../Entity/QueryEntities/019_01_02.robot | 50 +- .../Entity/QueryEntities/019_01_03.robot | 41 +- .../Entity/QueryEntities/019_01_04.robot | 48 +- .../Entity/QueryEntities/019_01_05.robot | 42 +- .../Entity/QueryEntities/019_02_01.robot | 44 +- .../Entity/QueryEntities/019_02_02.robot | 50 +- .../Entity/QueryEntities/019_02_03.robot | 41 +- .../Entity/QueryEntities/019_02_04.robot | 44 +- .../Entity/QueryEntities/019_02_05.robot | 41 +- .../Entity/QueryEntities/019_03_01.robot | 42 +- .../Entity/QueryEntities/019_03_02.robot | 45 +- .../Entity/QueryEntities/019_03_03.robot | 40 +- .../Entity/QueryEntities/019_03_04.robot | 38 +- .../Entity/QueryEntities/019_03_05.robot | 50 +- .../Entity/QueryEntities/019_04.robot | 47 +- .../Entity/QueryEntities/019_05.robot | 47 +- .../Entity/QueryEntities/019_06.robot | 50 +- .../Entity/RetrieveEntity/018_01_01.robot | 22 +- .../Entity/RetrieveEntity/018_01_02.robot | 38 +- .../Entity/RetrieveEntity/018_01_03.robot | 29 +- .../Entity/RetrieveEntity/018_02.robot | 25 +- .../Entity/RetrieveEntity/018_03_01.robot | 19 +- .../Entity/RetrieveEntity/018_03_02.robot | 33 +- .../Entity/RetrieveEntity/018_04.robot | 29 +- .../Entity/RetrieveEntity/018_05.robot | 26 +- .../Entity/RetrieveEntity/018_06.robot | 48 +- .../021_01.robot | 70 +- .../021_02.robot | 56 +- .../021_03.robot | 56 +- .../021_04.robot | 55 +- .../021_05.robot | 41 +- .../021_06.robot | 52 +- .../021_07.robot | 56 +- .../021_08.robot | 56 +- .../021_09.robot | 68 +- .../021_10.robot | 44 +- .../021_11.robot | 61 +- .../021_12.robot | 34 +- .../021_13.robot | 62 +- .../020_01.robot | 31 +- .../020_02.robot | 35 +- .../020_03.robot | 36 +- .../020_04.robot | 50 +- .../020_05.robot | 47 +- .../020_06.robot | 16 +- .../020_07.robot | 16 +- .../020_08.robot | 34 +- .../020_09.robot | 49 +- .../020_10.robot | 36 +- .../CreateBatchOfEntities/003_01.robot | 46 +- .../CreateBatchOfEntities/003_02.robot | 31 +- .../CreateBatchOfEntities/003_03.robot | 27 +- .../CreateBatchOfEntities/003_04.robot | 22 +- .../CreateBatchOfEntities/003_05.robot | 17 +- .../CreateBatchOfEntities/003_06.robot | 21 +- .../CreateBatchOfEntities/003_07.robot | 17 +- .../CreateBatchOfEntities/003_08.robot | 21 +- .../CreateBatchOfEntities/003_09.robot | 26 +- .../DeleteBatchOfEntities/006_01.robot | 21 +- .../DeleteBatchOfEntities/006_02.robot | 25 +- .../DeleteBatchOfEntities/006_03.robot | 27 +- .../UpdateBatchOfEntities/005_01.robot | 53 +- .../UpdateBatchOfEntities/005_02.robot | 55 +- .../UpdateBatchOfEntities/005_03.robot | 47 +- .../UpdateBatchOfEntities/005_04.robot | 27 +- .../UpsertBatchOfEntities/004_01.robot | 41 +- .../UpsertBatchOfEntities/004_02.robot | 55 +- .../UpsertBatchOfEntities/004_03.robot | 45 +- .../UpsertBatchOfEntities/004_04.robot | 49 +- .../UpsertBatchOfEntities/004_05.robot | 27 +- .../UpsertBatchOfEntities/004_06.robot | 27 +- .../Entities/CreateEntity/001_01.robot | 47 +- .../Entities/CreateEntity/001_02.robot | 28 +- .../Entities/CreateEntity/001_03.robot | 35 +- .../Entities/CreateEntity/001_04.robot | 25 +- .../Entities/CreateEntity/001_05.robot | 19 +- .../Entities/CreateEntity/001_06.robot | 28 +- .../Entities/CreateEntity/001_07.robot | 19 +- .../Entities/CreateEntity/001_08.robot | 28 +- .../Entities/CreateEntity/001_09.robot | 29 +- .../Entities/DeleteEntity/002_01.robot | 22 +- .../Entities/DeleteEntity/002_02.robot | 27 +- .../Entities/DeleteEntity/002_03.robot | 21 +- .../AppendEntityAttributes/010_01.robot | 67 +- .../AppendEntityAttributes/010_02.robot | 48 +- .../AppendEntityAttributes/010_03.robot | 23 +- .../DeleteEntityAttribute/013_01.robot | 53 +- .../DeleteEntityAttribute/013_02.robot | 46 +- .../DeleteEntityAttribute/013_03.robot | 48 +- .../PartialAttributeUpdate/012_01.robot | 47 +- .../PartialAttributeUpdate/012_02.robot | 62 +- .../PartialAttributeUpdate/012_03.robot | 61 +- .../UpdateEntityAttributes/011_01.robot | 46 +- .../UpdateEntityAttributes/011_02.robot | 54 +- .../UpdateEntityAttributes/011_03.robot | 23 +- .../007_01.robot | 53 +- .../007_02.robot | 29 +- .../009_01.robot | 29 +- .../009_02.robot | 32 +- .../009_03.robot | 21 +- .../008_01.robot | 38 +- .../AppendAttributes/014_01.robot | 38 +- .../AppendAttributes/014_02.robot | 41 +- .../AppendAttributes/014_03.robot | 31 +- .../DeleteAttribute/015_01.robot | 63 +- .../DeleteAttribute/015_02.robot | 59 +- .../DeleteAttribute/015_03.robot | 55 +- .../DeleteAttributeInstance/017_01.robot | 45 +- .../DeleteAttributeInstance/017_02.robot | 67 +- .../DeleteAttributeInstance/017_03.robot | 59 +- .../ModifyAttributeInstance/016_01.robot | 58 +- .../ModifyAttributeInstance/016_02.robot | 73 +- .../ModifyAttributeInstance/016_03.robot | 64 +- .../CreateSubscription/028_01.robot | 24 +- .../CreateSubscription/028_02.robot | 25 +- .../CreateSubscription/028_03.robot | 31 +- .../CreateSubscription/028_04.robot | 28 +- .../DeleteSubscription/032_01.robot | 25 +- .../DeleteSubscription/032_02.robot | 14 +- .../DeleteSubscription/032_03.robot | 29 +- .../Subscription/Notification/046_01.robot | 79 +- .../Subscription/Notification/046_02.robot | 86 +- .../Subscription/Notification/046_03.robot | 80 +- .../Subscription/Notification/046_04.robot | 81 +- .../Subscription/Notification/046_05.robot | 82 +- .../Subscription/Notification/046_06.robot | 71 +- .../Subscription/Notification/046_07.robot | 136 +- .../Subscription/Notification/046_08.robot | 121 +- .../Subscription/Notification/046_09.robot | 65 +- .../Subscription/Notification/046_10.robot | 86 +- .../Subscription/Notification/046_11.robot | 82 +- .../Subscription/Notification/046_12.robot | 101 +- .../Subscription/Notification/046_13.robot | 60 +- .../Subscription/Notification/046_14.robot | 85 +- .../QuerySubscriptions/031_01.robot | 59 +- .../QuerySubscriptions/031_02.robot | 72 +- .../RetrieveSubscription/030_01.robot | 22 +- .../RetrieveSubscription/030_02.robot | 14 +- .../RetrieveSubscription/030_03.robot | 31 +- .../UpdateSubscription/029_01.robot | 34 +- .../UpdateSubscription/029_02.robot | 26 +- .../UpdateSubscription/029_03.robot | 35 +- .../UpdateSubscription/029_04.robot | 35 +- .../UpdateSubscription/029_05.robot | 45 +- .../UpdateSubscription/029_06.robot | 42 +- .../UpdateSubscription/029_07.robot | 31 +- .../UpdateSubscription/029_08.robot | 31 +- .../UpdateSubscription/029_09.robot | 31 +- .../UpdateSubscription/029_10.robot | 42 +- .../UpdateSubscription/029_11.robot | 35 +- .../033_01_01.robot | 24 +- .../033_01_02.robot | 24 +- .../033_01_03.robot | 24 +- .../033_02.robot | 30 +- .../033_03.robot | 17 +- .../033_04.robot | 28 +- .../033_05.robot | 23 +- .../033_06.robot | 27 +- .../033_07.robot | 27 +- .../033_08.robot | 27 +- .../033_09.robot | 28 +- .../035_01.robot | 19 +- .../035_02.robot | 30 +- .../035_03.robot | 19 +- .../037_01.robot | 60 +- .../037_02.robot | 16 +- .../037_03.robot | 39 +- .../037_04.robot | 39 +- .../037_05.robot | 40 +- .../037_06.robot | 51 +- .../037_07.robot | 60 +- .../037_08.robot | 39 +- .../037_09.robot | 69 +- .../037_10.robot | 71 +- .../037_11.robot | 65 +- .../036_01.robot | 27 +- .../036_02.robot | 16 +- .../036_03.robot | 39 +- .../036_04.robot | 39 +- .../036_05.robot | 54 +- .../034_01.robot | 38 +- .../034_02.robot | 45 +- .../034_03.robot | 24 +- .../038_01.robot | 34 +- .../038_02.robot | 28 +- .../038_03.robot | 29 +- .../038_04.robot | 29 +- .../038_05.robot | 29 +- .../038_06.robot | 29 +- .../038_07.robot | 33 +- .../038_08.robot | 44 +- .../038_09.robot | 23 +- .../042_01.robot | 23 +- .../042_02.robot | 16 +- .../042_03.robot | 16 +- .../NotificationBehaviour/047_01.robot | 43 +- .../NotificationBehaviour/047_02.robot | 55 +- .../NotificationBehaviour/047_03.robot | 49 +- .../NotificationBehaviour/047_04.robot | 48 +- .../NotificationBehaviour/047_05.robot | 45 +- .../NotificationBehaviour/047_06.robot | 41 +- .../NotificationBehaviour/047_07.robot | 53 +- .../NotificationBehaviour/047_08.robot | 50 +- .../NotificationBehaviour/047_09.robot | 50 +- .../NotificationBehaviour/047_10.robot | 48 +- .../NotificationBehaviour/047_11.robot | 49 +- .../NotificationBehaviour/047_12.robot | 48 +- .../NotificationBehaviour/047_13.robot | 48 +- .../NotificationBehaviour/047_14.robot | 48 +- .../NotificationBehaviour/047_15.robot | 48 +- .../NotificationBehaviour/047_16.robot | 63 +- .../041_01.robot | 45 +- .../041_02.robot | 65 +- .../041_03.robot | 68 +- .../041_04.robot | 32 +- .../040_01.robot | 31 +- .../040_02.robot | 16 +- .../040_03.robot | 16 +- .../039_01.robot | 36 +- .../039_02.robot | 21 +- .../039_03.robot | 25 +- .../039_04.robot | 42 +- .../039_05.robot | 39 +- requirements.txt | 2 +- resources/ApiUtils.resource | 1942 +++++++++++------ resources/AssertionUtils.resource | 464 ++-- resources/HttpUtils.resource | 8 +- resources/JsonUtils.resource | 86 +- resources/MockServerUtils.resource | 38 +- resources/NotificationUtils.resource | 119 +- 245 files changed, 7803 insertions(+), 4838 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index d3b2f18b..fc06ed83 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -1,28 +1,36 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-unretrievable-context-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** Variable *** -${expected_status_code}= 503 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-unretrievable-context-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld *** Test Cases *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} @@ -32,7 +40,9 @@ ${registration_filename}= csourceRegistrations/context-source-registration-un ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} @@ -40,9 +50,14 @@ ${registration_filename}= csourceRegistrations/context-source-registration-un [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) [Tags] te-create 5_2_2 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -56,7 +71,9 @@ ${registration_filename}= csourceRegistrations/context-source-registration-un @{entities_to_be_created}= Create List ${first_entity} ${second_entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To ${expected_status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 6101bbdb..32b3ecf9 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -1,26 +1,37 @@ *** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.json +${attribute_id}= brandName +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-brandname-fragment.json -${attribute_id}= brandName -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json *** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${vehicle_fragment} + ... ${CONTENT_TYPE_MERGE_PATCH_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -30,6 +41,10 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-sample. ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_fragment} + ... ${CONTENT_TYPE_MERGE_PATCH_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 0793a171..a7aad16e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -1,28 +1,34 @@ *** Settings *** -Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +${registration_type}= Vehicle +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${teatype}= Vehicle +${content_type}= application/json -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld -${registration_type}= Vehicle -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${teatype}= Vehicle -${content_type}= application/json *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) [Tags] e-query 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} @@ -50,7 +56,11 @@ ${content_type}= application/json ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* + ${request} ${response}= Query Context Source Registrations With Return + ... id=${registration_id} + ... type=${registration_type} + ... context=${ngsild_test_suite_context} + ... accept=*/* Check Response Status Code 200 ${response['status']} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -60,9 +70,17 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) [Tags] te-query 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* + ${request} ${response}= Query Temporal Representation Of Entities With Return + ... entity_types=${teatype} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... context=${ngsild_test_suite_context} + ... accept=*/* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Headers Containing Content-Type set to ${response} ${content_type} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index efc916b2..f0b61393 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -1,31 +1,41 @@ *** Settings *** -Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_attribute}= speed +${vehicle_fragment}= vehicle-brandname-fragment.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${content_type}= application/xml -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= speed -${vehicle_fragment}= vehicle-brandname-fragment.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${content_type}= application/xml *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${content_type} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${vehicle_attribute} + ... ${vehicle_fragment} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -43,7 +53,10 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) [Tags] e-create 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -72,6 +85,9 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) [Tags] te-create 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index a46c31c4..1f8b1b7e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -1,23 +1,29 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${accept}= application/xml -${status_code}= 406 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${accept}= application/xml +${status_code}= 406 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld + *** Test Cases *** 044_04_01_endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) [Tags] e-query 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} @@ -49,5 +55,9 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... accept=${accept} Check Response Status Code Set To ${status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index f8b63f49..20f32c37 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${accept}= application/geo+json +${status_code}= 406 +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -*** Variable *** -${accept}= application/geo+json -${status_code}= 406 -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_05_01 Retrieve subscription by id @@ -25,7 +28,11 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... accept=${accept} Check Response Status Code Set To ${status_code} 044_05_03 Query context source registration diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index f4cf0a39..cf01a312 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -1,28 +1,39 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Case *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Attribute Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute [Tags] ed-attr 5_7_10 Retrieve Attribute attribute_name=airQualityLevel Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index 1cf3cc6c..c2fb7083 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/attribute-027-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/attribute-027-01-expectation.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Attribute [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Tags] ed-attr 5_7_10 @@ -19,10 +23,15 @@ Retrieve Detailed Representation Of Available Attribute Check Response Status Code Set To 200 Check Response Body Containing Attribute element ${expectation_file} + *** Keywords *** Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities 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 be48c9dd..17bb74b3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -1,35 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Available Attributes + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json - [Tags] ed-attrs 5_7_8 + [Tags] ed-attrs 5_7_8 + ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json +WithJsonLdContext [Tags] ed-attrs 5_7_8 + ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json - [Tags] ed-attrs 5_7_8 *** Keywords *** Retrieve Available Attributes - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD attributes + [Arguments] ${context} ${expectation_file} Retrieve Attributes ${context} Check Response Status Code Set To 200 Check Response Body Containing AttributeList element ${expectation_file} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index 850b8d6f..2ba0b2bf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -1,30 +1,45 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Case *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Entity Type Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type [Tags] ed-type 5_7_7 Retrieve Entity Type type=Building Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** 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 ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index fe997933..761260d9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Entity Type [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type [Tags] ed-type 5_7_7 @@ -19,12 +23,21 @@ Retrieve Detailed Representation Of Available Entity Type Check Response Status Code Set To 200 Check Response Body Containing EntityTypeInfo element ${expectation_file} + *** Keywords *** 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 ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} 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 e3a33a8e..22b2d42a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -1,30 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list of NGSI-LD entity types + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Available Entity Types + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json - [Tags] ed-types 5_7_5 + [Tags] ed-types 5_7_5 + ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json +WithJsonLdContext [Tags] ed-types 5_7_5 + ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json - [Tags] ed-types 5_7_5 *** Keywords *** Retrieve Available Entity Types - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD entity types + [Arguments] ${context} ${expectation_file} Retrieve Entity Types ${context} Check Response Status Code Set To 200 Check Response Body Containing EntityTypeList element ${expectation_file} @@ -32,8 +36,16 @@ 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 ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${first_filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${second_filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} 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 e6df2a5c..77ac8a2d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -1,35 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Details Of Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Details Of Available Attributes + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/attribute-026-01-01-expectation.json - [Tags] ed-attrs-details 5_7_9 + [Tags] ed-attrs-details 5_7_9 + ${EMPTY} types/expectations/attribute-026-01-01-expectation.json +WithJsonLdContext [Tags] ed-attrs-details 5_7_9 + ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json - [Tags] ed-attrs-details 5_7_9 *** Keywords *** Retrieve Details Of Available Attributes - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + [Arguments] ${context} ${expectation_file} Retrieve Attributes context=${context} details=${TRUE} Check Response Status Code Set To 200 Check Response Body Containing Attribute element ${expectation_file} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities 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 b03c52f3..3f76ca0e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -1,30 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Details Of Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Details Of Available Entity Types + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json - [Tags] ed-types-details 5_7_6 + [Tags] ed-types-details 5_7_6 + ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json +WithJsonLdContext [Tags] ed-types-details 5_7_6 + ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json - [Tags] ed-types-details 5_7_6 *** Keywords *** Retrieve Details Of Available Entity Types - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + [Arguments] ${context} ${expectation_file} Retrieve Entity Types context=${context} details=${TRUE} Check Response Status Code Set To 200 Check Response Body Containing EntityType element ${expectation_file} @@ -32,8 +36,16 @@ 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 ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${first_filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${second_filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} 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 ddecc8f5..6a44b0d9 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 @@ -1,36 +1,54 @@ *** Settings *** -Documentation Check that you can query several entities based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on ids -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{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} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_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 1bbc2efd..a33dd671 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 @@ -1,41 +1,57 @@ *** Settings *** -Documentation Check that you can query several entities based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the entities types -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking + *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${parking_filename} + ... ${parking_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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']} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity Elements With Different Types + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_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 9e10a94a..e4dece98 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 @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query several entities based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the given id pattern -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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} + ${response}= Query Entities + ... entity_id_pattern=${entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 65ac3884..1cdc121f 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 @@ -1,35 +1,51 @@ *** Settings *** -Documentation Check that you can query several entities based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on attribute names + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${filename2}= building-minimal-sample.jsonld -${expectation_filename}= building-attributes-query-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename2} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + ${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']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 9a8d7ab3..754d15c2 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 @@ -1,34 +1,50 @@ *** Settings *** -Documentation Check that you can query entitites based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites based on a list of properties -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-geoproperty-query-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location + *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{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} geoproperty=${geometry_property} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Query Entities + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geometry_property} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index f194aab7..f27065ef 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -1,36 +1,54 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on ids -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{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 Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities Via POST + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index f5a903a5..854ba8a4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -1,41 +1,57 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the entities types -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking + *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${parking_filename} + ... ${parking_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entity_types_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 38397fdf..32450318 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the given id pattern -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities Via POST + ... entity_id_pattern=${entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 04edd2e6..bc09646d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -1,33 +1,49 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on attribute names + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_retrieved} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 8a7c4828..b4d9dfe6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query entitites via POST Interaction based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites via POST Interaction based on a list of properties -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location + *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + ${response}= Query Entities Via POST + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_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 b1fe0765..1538368d 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 @@ -1,34 +1,48 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested ids are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested ids are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_invalid_id_one}= thisisaninvaliduri1 +${entity_invalid_id_two}= thisisaninvaliduri2 -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_invalid_id_one}= thisisaninvaliduri1 -${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 4e9e3e3d..c6e8d8d2 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 @@ -1,34 +1,49 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested entity types are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested entity types are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${invalid_entity_type_one}= type +${invalid_entity_type_two}= invalid_entity_type_two -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${invalid_entity_type_one}= type -${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_entity_type_one} ${invalid_entity_type_two} + ${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']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_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 9c86bba1..2ab80b97 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 @@ -1,32 +1,46 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested id pattern is incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested id pattern is incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_entity_id_pattern}= invalid_entity_id_pattern** -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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} + ${response}= Query Entities + ... entity_id_pattern=${invalid_entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 db5abf46..12ab098d 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 @@ -1,33 +1,45 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested attribute names are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested attribute names are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_attribute_one}= id +${invalid_attribute_two}= type -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= id -${invalid_attribute_two}= type *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 f603c3f1..1f1255e1 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 @@ -1,35 +1,53 @@ *** Settings *** -Documentation Check that you cannot query entitites if the request has a wrong geometryProperty -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entitites if the request has a wrong geometryProperty + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${entity_type}= Building +${georel}= invalid +${geometry}= Point +${coordinates}= [-8.503,41.202] +${geoproperty}= location -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${entity_type}= Building -${georel}= invalid -${geometry}= Point -${coordinates}= [-8.503,41.202] -${geoproperty}= location *** Test Cases *** Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geoproperty} georel=${georel} geometry=${geometry} coordinates=${coordinates} context=${ngsild_test_suite_context} + ${response}= Query Entities + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geoproperty} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... context=${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_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 4dd311ff..9cb3a2af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -1,37 +1,56 @@ *** Settings *** -Documentation Check that the queried entities by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by Id can be returned in a simplified representation -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${entity_type}= https://ngsi-ld-test-suite/context#Building +${options_parameter}= keyValues +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** 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 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{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} + ${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']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_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 9fa6c4eb..b903862f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -1,37 +1,56 @@ *** Settings *** -Documentation Check that the queried entities by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by id can be returned in a geoJSON format -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${accept_header}= application/geo+json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${accept_header}= application/geo+json + *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{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} accept=${accept_header} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... accept=${accept_header} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} 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 7ac6e809..7d239a29 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -1,36 +1,56 @@ *** Settings *** -Documentation Check that you can query entities specifying a maximum number of results -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entities specifying a maximum number of results + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${limit}= 2 -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} + ${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} + ${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']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Number Of Entities ${entity_type} ${2} + Check Response Body Containing Number Of Entities ${entity_type} ${2} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_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 f1d81a93..98120195 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 @@ -1,20 +1,26 @@ *** Settings *** -Documentation Check that you can get an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can get an entity by id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-expectation.jsonld + *** Test Cases *** 018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} 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 a4badafb..88ea67fa 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 @@ -1,25 +1,37 @@ *** Settings *** -Documentation Check that you can query some attributes from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query some attributes from an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-query-expectation.jsonld +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-query-expectation.jsonld -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${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 ba2888ba..2b311a5a 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 @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that you can query the geometry property from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query the geometry property from an entity -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-geoproperty-query-expectation.jsonld -${geometry_property}= location +${geometry_property}= location + *** Test Cases *** 018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index e03d9525..2ba3ed12 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot get an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Get Entity With Invalid/Missing Id +Documentation Check that you cannot get an entity with invalid/missing id -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01_Get an entity if the Entity Id is not present - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Get Entity With Invalid/Missing Id + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +018_02_01_Get an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 018_02_02_Get an entity if the Entity Id is not a valid URI - thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Get Entity With Invalid/Missing Id - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 50e53357..56ef5bb5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -1,11 +1,14 @@ *** Settings *** -Documentation Check that you cannot get an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if the entity id is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system @@ -14,5 +17,7 @@ Get an entity if the Entity Id is not known to the system ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 01e547bb..630c6754 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 @@ -1,24 +1,35 @@ *** Settings *** -Documentation Check that you cannot get an entity if an attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if an attribute is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${attribute_not_known}= property_not_found -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${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 1b623a6e..1370d9c2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that the queried entity by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by Id can be returned in a simplified representation -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld -${options_parameter}= keyValues +${options_parameter}= keyValues + *** Test Cases *** 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} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${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 828c3b0d..5d5eb854 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -1,22 +1,28 @@ *** Settings *** -Documentation Check that the queried entity by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by id can be returned in a geoJSON format -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${accept_header}= application/geo+json +${options_parameter}= keyValues +${accept_header}= application/geo+json + *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} Check Response Status Code 200 ${response['status']} 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 5854b089..1875e2e9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -1,38 +1,46 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entity -Suite Teardown Delete Created Entity -Test Template Check Json-LD Resolution When retrieving an entity - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entity +Suite Teardown Delete Created Entity +Test Template Check Json-LD Resolution When retrieving an entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-compacted-expectation.json -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext - ${EMPTY} ${empty_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + [Tags] e-retrieve 6_3_5 + ${EMPTY} ${empty_jsonld_expectation_filename} CreationTimeJsonLdContext - ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 + [Tags] e-retrieve 6_3_5 + ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} + *** Keywords *** Check Json-LD Resolution When retrieving an entity - [Arguments] ${context} ${expected_payload} [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Arguments] ${context} ${expected_payload} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Set Suite 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 4835e721..1d280eb4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -1,42 +1,58 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld - -*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Before before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + + +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +After [Tags] te-query 5_7_4 + after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld +Before [Tags] te-query 5_7_4 + before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities - [Arguments] ${timerel} ${timeAt} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities + [Arguments] ${timerel} ${timeAt} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} 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 ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + 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 Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 c9ddf4ea..73695a9d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -1,34 +1,52 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of certain attributes of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of certain attributes of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of certain attributes of entities [Documentation] Check that you can query the temporal evolution of certain attributes of entities [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 8e4ae663..b48e938e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of the last N instances of entities attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of the last N instances of entities attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you 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 - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 91ec8bba..8ad92735 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -1,33 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities using a context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 aaaa9549..f6809bec 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -1,27 +1,38 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given type(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: +Documentation Check that you can query the temporal evolution of entities matching the given type(s) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld + -*** Test Case *** +*** Test Cases *** Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you 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 - 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} + 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 Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial 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 a7109959..67c5a413 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -1,34 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given identifier(s) [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) [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} - 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} + 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 Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 4c55cf96..c6ef14aa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given id pattern + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you 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 - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 aab99ae5..8ea5288c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you 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 - 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} + 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} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 a2fde19f..7d2f24ab 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -1,40 +1,58 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld - -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Within Polygon contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE +Near Point [Tags] te-query 5_7_4 + near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld +Within Polygon [Tags] te-query 5_7_4 + contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities matching the given NGSI-LD geo-query - [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} [Documentation] Check that you 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 - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... geoproperty=${geoproperty} + ... 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 Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index ea947e1d..544dc923 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -1,31 +1,43 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource -Suite Setup Create Initial Context Source Registration -Suite Teardown Delete Initial Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_url}= http://${context_source_host}:${context_source_port} - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Suite Setup Create Initial Context Source Registration +Suite Teardown Delete Initial Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_url}= http://${context_source_host}:${context_source_port} + + +*** Test Cases *** Query the temporal evolution of entities matching the given NGSI-LD context source filter [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... csf=endpoint=="${context_source_url}" + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Wait for redirected request Check Response Status Code Set To 200 + *** Keywords *** Create Initial Context Source Registration Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} 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 7f557d06..2b30e80d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -1,42 +1,57 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + *** Test Cases *** LIMIT Query Some entities - ${2} - [Tags] te-query 5_7_4 - + [Tags] te-query 5_7_4 + ${2} Query All entities - ${3} - [Tags] te-query 5_7_4 + [Tags] te-query 5_7_4 + ${3} + *** Keywords *** Query the temporal evolution of entities with a limit to the number of entities to be retrieved - [Arguments] ${limit} [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + [Arguments] ${limit} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus,Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... limit=${limit} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities Vehicle ${limit} + Check Response Body Containing Number Of Entities Vehicle ${limit} 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 ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${third_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} Set Suite Variable ${third_temporal_entity_representation_id} 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 8aea5ab2..dfed8f79 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Case *** + +*** Test Cases *** Query the temporal evolution of entities with an invalid request [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request [Tags] te-query 5_7_4 - Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} 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 7bd851b6..2f865194 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -1,38 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using the entityOperations method -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities using the entityOperations method - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld - -*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE -After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities using the entityOperations method + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities using the entityOperations method + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + + +*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE +After [Tags] te-query 5_7_4 + entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld +Before [Tags] te-query 5_7_4 + entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities using the entityOperations method - [Arguments] ${payload_file} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method - Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + [Arguments] ${payload_file} ${expectation_file} + Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} 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} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} 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 357363c8..884d2046 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -1,23 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity [Documentation] Check that you can retrieve the temporal evolution of an entity [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities 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 6f72293b..bd965bf3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity using a context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities 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 bc181809..16ad9623 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of certain attributes of an entity [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... attrs=${temporal_attributes_to_be_retrieved} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities 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 558a569e..8e5789b9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -1,33 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 -Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE +After [Tags] te-retrieve 5_7_3 + after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld +Before [Tags] te-retrieve 5_7_3 + before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld +Between [Tags] te-retrieve 5_7_3 + between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld -Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld - [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} 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 16a2ec54..274a150b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -1,32 +1,41 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of the last N instances of entity attributes - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of the last N instances of entity attributes + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld -*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE -Retrieve Some Instances - ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 +*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE +Retrieve Some Instances + [Tags] te-retrieve 5_7_3 + ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld Retrieve All Instances - ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 + [Tags] te-retrieve 5_7_3 + ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + *** Keywords *** Retrieve the temporal evolution of the last N instances of entity attributes - [Arguments] ${lastN} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} + [Arguments] ${lastN} ${vehicle_expectation_file} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... lastN=${lastN} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 7354c0af..7cfec33b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve the temporal evolution of an entity with an invalid id [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 762b54f1..1d44b0f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve the temporal evolution of a non-existing entity [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 11ece9f5..a56bd842 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -1,25 +1,35 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of non-existing entity attributes [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... attrs=${temporal_attributes_to_be_retrieved} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} 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 24c23044..b8b5ce55 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -1,33 +1,42 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity with an invalid request content - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity with an invalid request content + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT -After after ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 -Before before ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT +After [Tags] te-retrieve 5_7_3 + after ${EMPTY} ${EMPTY} +Before [Tags] te-retrieve 5_7_3 + before ${EMPTY} ${EMPTY} +Between [Tags] te-retrieve 5_7_3 + between 2020-08-01T12:00:00Z ${EMPTY} -Between between 2020-08-01T12:00:00Z ${EMPTY} - [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity with an invalid request content - [Arguments] ${timerel} ${timeAt} ${endTimeAt} [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Entities 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 3a8e53a5..0cea8d05 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity with the simplified temporal representation [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... options=${options} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities 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 6e57f39b..d79401ef 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -1,33 +1,35 @@ *** Settings *** -Documentation Check that you can create a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Batch Create Entity Scenarios +Documentation Check that you can create a batch of entities -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME -MinimalEntity building-minimal-sample.jsonld - [Tags] be-create 5_6_7 +Test Template Batch Create Entity Scenarios -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-create 5_6_7 -EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-create 5_6_7 +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME +MinimalEntity [Tags] be-create 5_6_7 + building-minimal-sample.jsonld +EntityWithSimpleProperties + [Tags] be-create 5_6_7 + building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships + [Tags] be-create 5_6_7 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-create 5_6_7 + [Tags] be-create 5_6_7 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Create Entity Scenarios - [Arguments] ${filename} [Documentation] Check that you can create a batch of entities + [Arguments] ${filename} ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${filename} ${first_entity_id} @@ -38,6 +40,10 @@ Batch Create Entity Scenarios ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${entities_to_be_queried} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Created Resources Set To ${entities_to_be_created} Batch Delete Entities @{expected_entities_ids} 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 f5533c25..9f0e90eb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you can create a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Documentation Check that you can create a batch of entities where some will succeed and others will fail -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of two valid entities and one invalid entity [Documentation] Check that you can create a batch of two valid entities and one invalid entity [Tags] be-create 5_6_7 @@ -22,16 +26,23 @@ Create a batch of two valid entities and one invalid entity Batch Create Entities @{entities_to_be_created} @{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} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} + *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index e60bc441..afbc5db4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot create a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Batch Entity With Invalid Request Scenarios +Documentation Check that you cannot create a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-create 5_6_7 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Batch Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-create 5_6_7 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson [Tags] be-create 5_6_7 + batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-create 5_6_7 *** Keywords *** Create Batch Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot create a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 1a547522..f78f2faa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -1,20 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] be-create 6_3_5 ${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} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Batch Create Entities + ... @{entities_to_be_created} + ... content_type=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 201 Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity 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 292e09ad..de136701 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] be-create 6_3_5 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 3c8855f2..538c0f8d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] be-create 6_3_5 @@ -16,5 +19,7 @@ Create a batch of one entity containing a JSON-LD @context with a JSON content t @{entities_to_be_created}= Create List ${entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 29ba557f..9aa8dc7a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] be-create 6_3_5 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 e9f550f6..9926817d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] be-create 6_3_5 @@ -16,5 +19,7 @@ Create a batch of one entity not containing a JSON-LD @context with a JSON-LD co @{entities_to_be_created}= Create List ${entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 6db7bf66..53810f46 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -1,20 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] be-create 6_3_5 ${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} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Batch Create Entities + ... @{entities_to_be_created} + ... content_type=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 b305333c..917b0813 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you can delete a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Documentation Check that you can delete a batch of entities -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] be-delete 5_6_10 @@ -19,6 +23,7 @@ Delete a batch of entities Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources + *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} 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 f37b0f36..09e8e652 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you can delete a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Documentation Check that you can delete a batch of entities where some will succeed and others will fail -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Delete a batch of non existing and existing entities [Documentation] Check that you can delete a batch of non existing and existing entities [Tags] be-delete 5_6_10 @@ -17,13 +21,16 @@ Delete a batch of non existing and existing entities Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources + *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index bf013682..c36cc59e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot delete a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Delete Entity With Invalid Request Scenarios +Documentation Check that you cannot delete a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-delete 5_6_10 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Delete Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-delete 5_6_10 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson [Tags] be-delete 5_6_10 + batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-delete 5_6_10 *** Keywords *** Batch Delete Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot delete a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 68953588..9cd6e877 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -1,33 +1,36 @@ *** Settings *** -Documentation Check that you can update a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Update Entity Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json - [Tags] be-update 5_6_9 +Documentation Check that you can update a batch of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Update Entity Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld -EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-update 5_6_9 +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + [Tags] be-update 5_6_9 + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json +EntityWithSimpleRelationships + [Tags] be-update 5_6_9 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json - [Tags] be-update 5_6_9 + [Tags] be-update 5_6_9 + building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json + *** Keywords *** Batch Update Entity Scenarios - [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities + [Arguments] ${filename} ${update_fragment_filename} ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @@ -41,7 +44,11 @@ Batch Update Entity Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Setup 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 264a45f0..005e8145 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -1,39 +1,42 @@ *** Settings *** -Documentation Check that you can update a batch of entities with noOverwrite option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Update Entity With NoOverwrite Option Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 - [Tags] be-update 5_6_9 +Documentation Check that you can update a batch of entities with noOverwrite option -EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 - [Tags] be-update 5_6_9 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Update Entity With NoOverwrite Option Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld + +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS +EntityWithSimpleProperties + [Tags] be-update 5_6_9 + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 +EntityWithSimpleRelationships + [Tags] be-update 5_6_9 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 - [Tags] be-update 5_6_9 + [Tags] be-update 5_6_9 + building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 + *** Keywords *** Batch Update Entity With NoOverwrite Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} ${expected_status} [Documentation] Check that you can update a batch of entities with noOverwrite option + [Arguments] ${filename} ${update_fragment_filename} ${expected_status} ${first_entity}= Load Entity ${filename} ${first_entity_id} ${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} Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite - Check Response Status Code Set To ${expected_status} + Check Response Status Code Set To ${expected_status} ${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} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -41,7 +44,11 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Setup 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 77275037..a11ee112 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -1,41 +1,58 @@ *** Settings *** -Documentation Check that you can update a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld +Documentation Check that you can update a batch of entities where some will succeed and others will fail + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of-property-fragment.json -*** Test Case *** + +*** Test Cases *** Update a batch of non existing and existing entities [Documentation] Check that you can update a batch of non existing and existing entities [Tags] be-update 5_6_9 - ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} - ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} + ${first_existing_entity}= Load Entity + ... building-relationship-of-property-sample.jsonld + ... ${first_existing_entity_id} + ${second_existing_entity}= Load Entity + ... building-relationship-of-property-sample.jsonld + ... ${second_existing_entity_id} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} - ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_existing_entity_id} + ${second_created_entity}= Load Test Sample + ... entities/${entity_payload_filename} + ... ${second_existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Batch Delete Entities @{expected_successful_entities_ids} + *** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index d7944d3e..e00b0a4e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot update a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Update Entity With Invalid Request Scenarios +Documentation Check that you cannot update a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-update 5_6_9 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Update Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-update 5_6_9 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd [Tags] be-update 5_6_9 + batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot update a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 5eceefe3..71ed7794 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -1,30 +1,33 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing entities and they will be created -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Batch Upsert Entity Scenarios +Documentation Check that you can upsert a batch of non-existing entities and they will be created + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Batch Upsert Entity Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Entity Scenarios - [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing entities + [Arguments] ${filename} ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${filename} ${first_entity_id} @@ -35,6 +38,10 @@ Batch Upsert Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} Batch Delete Entities @{expected_entities_ids} 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 47992d03..60408778 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -1,44 +1,57 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Non-existing And Existing Entities Scenarios -Test Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Non-existing And Existing Entities Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Non-existing And Existing Entities Scenarios - [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing and existing entities + [Arguments] ${filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${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 ${new_entity} ${first_existing_entity} ${second_existing_entity} + @{entities_to_be_upserted}= Create List + ... ${new_entity} + ... ${first_existing_entity} + ... ${second_existing_entity} Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + @{upserted_entities_ids}= Create List + ... ${new_entity_id} + ... ${first_existing_entity_id} + ... ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} 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 a79bec7b..882bab4d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -1,32 +1,35 @@ *** Settings *** -Documentation Check that you can upsert a batch of existing entities and they will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Existing Entities Scenarios -Test Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of existing entities and they will be replaced + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Existing Entities Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Existing Entities Scenarios - [Arguments] ${filename} [Documentation] Check that you can upsert a batch of existing entities + [Arguments] ${filename} ${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} @@ -34,7 +37,11 @@ Batch Upsert Existing Entities Scenarios Check Response Status Code Set To 204 @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} Setup 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 0bd4d44b..9673baf0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -1,33 +1,36 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities with update option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Entities With Update Option Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Documentation Check that you can upsert a batch of entities with update option + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Entities With Update Option Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: ${existing_entity_payload_filename}= building-minimal-sample.jsonld -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json - [Tags] be-upsert 5_6_8 +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json + *** Keywords *** Batch Upsert Entities With Update Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can upsert a batch of entities with update option + [Arguments] ${filename} ${update_fragment_filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @@ -42,7 +45,11 @@ Batch Upsert Entities With Update Option Scenarios ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} 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 dbcfb12e..b66d407e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Upsert a batch of two valid entities and one invalid entity [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity [Tags] be-upsert 5_6_8 @@ -22,11 +25,17 @@ Upsert a batch of two valid entities and one invalid entity Batch Upsert Entities @{entities_to_be_upserted} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${third_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} Check Updated Resources Set To ${upserted_entities} Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 584c2a75..1b8c9cc3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot upsert a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Upsert Entity With Invalid Request Scenarios +Documentation Check that you cannot upsert a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-upsert 5_6_8 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Upsert Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-upsert 5_6_8 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd [Tags] be-upsert 5_6_8 + batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot upsert a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 950f90ac..a2a680ab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -1,37 +1,46 @@ *** Settings *** -Documentation Check that you can create an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Entity Scenarios +Documentation Check that you can create an entity -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_01_MinimalEntity - building-minimal-without-context-sample.jsonld application/json +Test Template Create Entity Scenarios -001_01_02_EntityWithSimpleProperties - building-simple-attributes-sample.jsonld application/ld+json -001_01_03_EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld application/ld+json +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_01_MinimalEntity + building-minimal-without-context-sample.jsonld application/json +001_01_02_EntityWithSimpleProperties + building-simple-attributes-sample.jsonld application/ld+json +001_01_03_EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld application/ld+json 001_01_04_EntityWithLocationAttribute - building-location-attribute-sample.jsonld application/ld+json + building-location-attribute-sample.jsonld application/ld+json + *** Keywords *** Create Entity Scenarios - [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity [Tags] e-create 5_6_1 + [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} - Run Keyword If '${content_type}'=='application/json' Retrieve Entity by Id ${entity_id} ${content_type} - Run Keyword If '${content_type}'=='application/ld+json' Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + IF '${content_type}'=='application/json' + Retrieve Entity by Id ${entity_id} ${content_type} + END + IF '${content_type}'=='application/ld+json' + Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + END Check Created Resource Set To ${created_entity} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index a02843a9..061bdd72 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -1,25 +1,29 @@ *** Settings *** -Documentation Check that you cannot create an entity with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Entity With Invalid Request Scenarios +Documentation Check that you cannot create an entity with an invalid request -*** Test Cases *** FILENAME ERROR_TYPE -001_02_01_InvalidJson - invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Entity With Invalid Request Scenarios -001_02_02_EmptyJson - empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +*** Test Cases *** FILENAME ERROR_TYPE +001_02_01_InvalidJson + invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +001_02_02_EmptyJson + empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext - building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Create Entity With Invalid Request Scenarios - [Arguments] ${filename} ${error_type} [Documentation] Check that you cannot create an entity with an invalid request [Tags] e-create 5_6_1 + [Arguments] ${filename} ${error_type} Request Entity From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${error_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${error_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 e0fac02b..c5dc1981 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -1,23 +1,34 @@ *** Settings *** -Documentation Check that you cannot create an entity with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create an entity with an existing id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${content_type}= application/ld+json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${content_type}= application/ld+json + + +*** Test Cases *** Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index beefc9dd..3c5d816c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -1,19 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index e586dc5d..826c6940 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] e-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index eaec816c..5b39952d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -1,19 +1,27 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index ed53efb7..4e40f111 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] e-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index 1de14b95..51efb05e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -1,19 +1,27 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index 04a0f4dd..e48f067a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -1,19 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 0ba8c5ac..1a5a555f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -1,18 +1,24 @@ *** Settings *** -Documentation Check that you can delete an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an entity by id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Delete an entity [Documentation] Check that you can delete an entity by id [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + ${request} ${response}= Create Entity Selecting Content Type + ... building-simple-attributes-sample.jsonld + ... ${entity_id} + ... application/ld+json Check Response Status Code 201 ${response['status']} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 56ca59e8..a3b5e073 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -1,23 +1,28 @@ *** Settings *** -Documentation Check that you cannot delete an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Entity Scenarios +Documentation Check that you cannot delete an entity with invalid/missing id -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_02_01_Delete an entity if the Entity Id is not present - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Entity Scenarios + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +002_02_01_Delete an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 002_02_02_Delete an entity if the Entity Id is not a valid URI - thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Delete Entity Scenarios - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id [Tags] e-delete 5_6_6 + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index 9ff21f86..fc9f8d10 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -1,19 +1,24 @@ *** Settings *** -Documentation Check that you cannot delete an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an entity if the entity id is not known to the system -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: ${expected_status_code}= 404 -*** Test Case *** + +*** Test Cases *** Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index fbb6af91..345f90e0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -1,33 +1,54 @@ *** Settings *** -Documentation Check that you can append entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can append entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** 010_01_01_Append entity attributes - Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld + Append Attributes Without Params + ... 204 + ... vehicle-new-attribute-fragment.jsonld + ... vehicle-speed-appended-expectation.jsonld 010_01_02_Append entity attributes - Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld + Append Attributes With Params + ... 207 + ... vehicle-attribute-to-add-fragment.jsonld + ... add-attribute-expectation.jsonld + ... vehicle-speed-appended-expectation.jsonld 010_01_03_Append entity attributes - Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes Without Params + ... 204 + ... vehicle-speed-different-datasetid-fragment.jsonld + ... vehicle-speed-different-datasetid-expectation.jsonld 010_01_04_Append entity attributes - Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes With Params + ... 204 + ... vehicle-speed-different-datasetid-fragment.jsonld + ... ${EMPTY} + ... vehicle-speed-different-datasetid-expectation.jsonld + *** Keywords *** Append Attributes Without Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] ea-append 5_6_3 + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} @@ -37,16 +58,28 @@ Append Attributes Without Params [Teardown] Delete Entity by Id Returning Response ${entity_id} Append Attributes With Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] ea-append 5_6_3 + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite + ${response}= Append Entity Attributes With Parameters + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... noOverwrite Check Response Status Code ${status_code} ${response['status']} # ignore the reason for the not updated attribute as this detail is up to each context broker implementation - Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + IF "${expectation_response_body}"!="${EMPTY}" + Check Response Body Content + ... ${expectation_response_body} + ... ${response['body']} + ... root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + END ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index a0ba000b..79a09e95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -1,15 +1,18 @@ *** Settings *** -Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -${status_code}= 400 -${invalid_fragment_filename}= invalid-fragment.jsonld +Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld +${status_code}= 400 +${invalid_fragment_filename}= invalid-fragment.jsonld + *** Test Cases *** 010_02_01_Append entity attributes if the entity Id is not present @@ -21,17 +24,23 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld 010_02_03_Append entity attributes with invalid entity fragments Append entity attributes with invalid entity fragments + *** Keywords *** Append Attributes - [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body [Tags] ea-append 5_6_3 + [Arguments] ${entity_invalid_id} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -39,9 +48,16 @@ Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Append Entity Attributes Using Session + ... ${entity_id} + ... ${invalid_fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... ${EMPTY} Check RL Response Status Code Set To ${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()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 3421a072..caecdd7d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that you cannot append entity attributes if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot append entity attributes if the entity id is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system @@ -15,9 +18,11 @@ Append entity attributes when the entity id is not known to the system ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -*** Keywords *** +*** Keywords *** [Teardown] Delete Entity by Id Returning Response ${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 9837ae42..3dd3b1ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -1,35 +1,46 @@ *** Settings *** -Documentation Check that you can delete an attribute from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 204 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${attribute_id}= speed - -*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME -013_01_01_delete an attribute with the default instance - ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +Documentation Check that you can delete an attribute from an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 204 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${attribute_id}= speed -013_01_02_delete an attribute with the datasetId - urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld +*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME +013_01_01_delete an attribute with the default instance + ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +013_01_02_delete an attribute with the datasetId + urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld 013_01_03_delete all target attribute instances - ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld + ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld + *** Keywords *** Delete Attributes - [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} [Documentation] Check that you 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} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${datasetId} + ... ${deleteAll} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 2ef3f055..094b3eaa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -013_02_01_delete an attribute if the Entity Id is not present - ${EMPTY} speed +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -013_02_02_delete an attribute if the Entity Id is not a valid URI - thisIsAnInvalidURI speed +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +013_02_01_delete an attribute if the Entity Id is not present + ${EMPTY} speed +013_02_02_delete an attribute if the Entity Id is not a valid URI + thisIsAnInvalidURI speed 013_02_03_delete an attribute if the Attribute Name is not present - ${valid_entity_id} ${EMPTY} + ${valid_entity_id} ${EMPTY} + *** Keywords *** Delete Attributes - [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 34e3bd8f..9d2c56c4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -1,32 +1,35 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID -013_03_01_delete an attribute when the Entity Id is not known to the system - ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -013_03_02_delete an attribute when the Entity does not contain the target attribute id - ${valid_entity_id} notFound ${EMPTY} +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID +013_03_01_delete an attribute when the Entity Id is not known to the system + ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +013_03_02_delete an attribute when the Entity does not contain the target attribute id + ${valid_entity_id} notFound ${EMPTY} 013_03_03_delete an attribute when the Entity does not contain the target attribute with same datasetId - ${valid_entity_id} speed urn:ngsi-ld:Property:notFound + ${valid_entity_id} speed urn:ngsi-ld:Property:notFound + *** Keywords *** Delete Attributes - [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 + [Arguments] ${entity_id} ${attribute_id} ${datasetId} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -34,7 +37,10 @@ Delete Attributes Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 3c697912..e8117d22 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -1,31 +1,42 @@ *** Settings *** -Documentation Check that you can perform a partial update on an entity attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 204 - -*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME -012_01_01_Check that you can partially update an attribute - vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld +Documentation Check that you can perform a partial update on an entity attribute + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 204 + +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_01_01_Check that you can partially update an attribute + vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld 012_01_02_Check that you can partially update an attribute by specifying the datasetId - vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld + vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld + *** Keywords *** Update Attributes - [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} [Documentation] Check that you can perform a partial update on an entity attribute [Tags] ea-partial-update 5_6_4 + [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index d9652e38..2195665d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -1,42 +1,52 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${status_code}= 400 - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -012_02_01_Make a partial attribute update if the Entity Id is not present - ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids -012_02_02_Make a partial attribute update if the Entity Id is not a valid URI - thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -012_02_03_Make a partial attribute update if the Attribute Id is not present - ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld +Suite Setup Setup Initial Entities +Test Template Update Attributes -012_02_04_Make a partial attribute update if the Attribute type does not match - ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${status_code}= 400 + + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME +012_02_01_Make a partial attribute update if the Entity Id is not present + ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI + thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_03_Make a partial attribute update if the Attribute Id is not present + ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld +012_02_04_Make a partial attribute update if the Attribute type does not match + ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld 012_02_05_Make a partial attribute update if the entity fragment is empty - ${valid_entity_id} speed empty-fragment.json + ${valid_entity_id} speed empty-fragment.json + *** Keywords *** Update Attributes - [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] ea-partial-update 5_6_4 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index dee5e2f4..5eda275e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -1,40 +1,51 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Partial Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 404 -${attribute_id}= speed - -*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME -012_03_01_Partial update when the Entity Id is not known to the system - ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld +Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system -012_03_02_Partial update when no default instance and no datasetId specified - ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Partial Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 404 +${attribute_id}= speed -012_03_03_Partial update when no instance with the datasetId specified - ${valid_entity_id} vehicle-isparked-fragment.jsonld +*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME +012_03_01_Partial update when the Entity Id is not known to the system + ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld +012_03_02_Partial update when no default instance and no datasetId specified + ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld +012_03_03_Partial update when no instance with the datasetId specified + ${valid_entity_id} vehicle-isparked-fragment.jsonld 012_03_04_Partial update when no instance with the attrId specified - ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld + ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld + *** Keywords *** Partial Update Attributes - [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system [Tags] ea-partial-update 5_6_4 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${fragment_filename} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index c4a76f10..af12e56b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check that you can update entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes +Documentation Check that you can update entity attributes -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId - 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +Test Template Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -011_01_02_Check that you can update existing attributes with the datasetId - 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME +011_01_01_Check that you can update existing attributes with no datasetId + 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +011_01_02_Check that you can update existing attributes with the datasetId + 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld 011_01_03_Check that you can update only some attributes while others failed - 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld + 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld + *** Keywords *** Update Attributes - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes [Tags] ea-update 5_6_2 + [Arguments] + ... ${status_code} + ... ${fragment_filename} + ... ${expectation_response_filename} + ... ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Run Keyword If "${expectation_response_filename}"!="${EMPTY}" Check Response Body Content ${expectation_response_filename} ${response['body']} + IF "${expectation_response_filename}"!="${EMPTY}" + Check Response Body Content ${expectation_response_filename} ${response['body']} + END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index 9041bebc..c786688c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -1,44 +1,68 @@ *** Settings *** -Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: *** Test Cases *** 011_02_01_Update an attribute if the Entity Id is not present - Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + Update Attributes + ... ${EMPTY} + ... vehicle-two-datasetid-attributes-sample.jsonld + ... vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_02_Update an attribute if the Entity Id is not a valid URI - Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + Update Attributes + ... thisisaninvaliduri + ... vehicle-two-datasetid-attributes-sample.jsonld + ... vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_03_Update entity attributes with invalid entity fragments - Update entity attributes with invalid entity fragments vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld + Update entity attributes with invalid entity fragments + ... vehicle-speed-two-datasetid-sample.jsonld + ... invalid-fragment.jsonld + *** Keywords *** Update Attributes - [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body [Tags] ea-update 5_6_2 + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} Update entity attributes with invalid entity fragments - [Arguments] ${filename} ${fragment_filename} [Documentation] Check that you cannot update an attribute if the entity fragment is invalid [Tags] ea-update 5_6_2 + [Arguments] ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Update Entity Attributes Using Session + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... ${EMPTY} Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 8ba03764..4fed6327 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system @@ -15,9 +18,11 @@ Update entity attributes when the entity id is not known to the system ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -*** Keywords *** +*** Keywords *** [Teardown] Delete Entity by Id Returning Response ${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 caa98220..409b05be 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -1,32 +1,49 @@ *** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Temporal Entity +Documentation Check that you can create a temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE -007_01_01_Create a temporal representation of an entity - vehicle-create-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json +Test Template Create Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity + vehicle-create-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json 007_01_02_Create a temporal entity with no context - vehicle-create-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json + vehicle-create-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json + *** Keywords *** Create Temporal Entity - [Arguments] ${filename} ${expectation_filename} ${content_type} [Documentation] Check that you can create a temporal representation of an entity [Tags] te-create 5_6_11 + [Arguments] ${filename} ${expectation_filename} ${content_type} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${content_type} Check Response Status Code 201 ${response['status']} - ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Run Keyword If '${content_type}'=='application/json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - Run Keyword If '${content_type}'=='application/ld+json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} - ${ignored_attributes}= Create List instanceId @context - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + ${created_temporal_entity}= Load Test Sample + ... temporalEntities/${filename} + ... ${temporal_entity_representation_id} + IF '${content_type}'=='application/json' + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + END + IF '${content_type}'=='application/ld+json' + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + END + ${ignored_attributes}= Create List instanceId @context + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} Check Created Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 465aff08..53d97144 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -1,11 +1,14 @@ *** Settings *** -Documentation Check that you cannot create a temporal entity with an empty/invalid json/id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${status_code}= 400 -*** Variable *** -${status_code}= 400 *** Test Cases *** 007_02_01_Create a temporal entity with an invalid json @@ -20,20 +23,26 @@ ${status_code}= 400 007_02_04_Create a temporal invalid URI Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + *** Keywords *** Create Temporal Entity From File - [Arguments] ${filename} [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id [Tags] te-create 5_6_11 - Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${filename} + Create Temporal Representation Of Entity Selecting Content Type Using Session + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} Create Temporal Entity - [Arguments] ${entity_id} ${filename} [Documentation] Check that you cannot create a temporal entity with an invalid @context [Tags] te-create 5_6_11 - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${filename} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index f8e9fa2d..d03e8368 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -1,21 +1,30 @@ *** Settings *** -Documentation Check that you can delete a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** Delete a temporal representation of an entity with simple temporal properties [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties [Tags] te-delete 5_6_16 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + ${response}= Delete Temporal Representation Of Entity With Returning Response + ... ${temporal_entity_representation_id} Check Response Status Code 204 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 5c78f4bc..6c681856 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -1,26 +1,32 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Temporal Entity +Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE -009_02_01_Delete a temporal representation of an entity with an empty entity id - 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE +009_02_01_Delete a temporal representation of an entity with an empty entity id + 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} 009_02_02 Delete a temporal representation of an entity with an invalid entity id - 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Delete Temporal Entity - [Arguments] ${status_code} ${id} ${problem_type} [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId [Tags] te-delete 5_6_16 + [Arguments] ${status_code} ${id} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 826558e2..489df5ea 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 *** Test Cases *** 009_03 Delete a temporal representation of an entity with a unknown entity id @@ -15,5 +18,7 @@ ${status_code}= 404 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} 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 9285749c..c2042366 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -1,26 +1,40 @@ *** Settings *** -Documentation Check that you can update a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can update a temporal representation of an entity with simple temporal properties -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-create-temporal-representation-sample.jsonld -${update_filename}= vehicle-temporal-representation-update-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-create-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld ${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld + *** Test Cases *** 008_01_Update a temporal representation of an entity with simple temporal properties [Documentation] Check that you 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} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${update_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index ca86bcfa..7331164d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -1,26 +1,40 @@ *** Settings *** -Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld + *** Test Cases *** 014_01_Add an attribute to a temporal entity with simple temporal properties [Documentation] Check that you 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} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Append Attribute To Temporal Entity + ... ${temporal_entity_representation_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index f8a5d788..d7ca68d1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 400 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 400 *** Test Cases *** 014_02_01_Add an attribute to a temporal representation of an entity with invalid content @@ -23,26 +26,36 @@ ${status_code}= 400 014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id Add Attribute To Temporal Entity thisIsAninvalidId + *** Keywords *** Add an Attribute To a Temporal Entity From File - [Arguments] ${update_filename} [Documentation] Check that an error is raised if you add a temporal entity attribute with empty/invalid content [Tags] tea-append 5_6_12 + [Arguments] ${update_filename} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Append Attribute To Temporal Entity Using Session + ... ${temporal_entity_representation_id} + ... ${update_filename} + ... ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To ${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} Add Attribute To Temporal Entity - [Arguments] ${id} [Documentation] Check that an error is raised if you add a temporal entity attribute with a non existing/invalid EnityId [Tags] tea-append 5_6_12 + [Arguments] ${id} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 9b14db12..375900cf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that an error is raised if you add an attribute to a non existent entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you add an attribute to a non existent entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 404 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity [Documentation] Check that an error is raised if you add an attribute to a non existent entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${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} + ${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']} [Teardown] 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 6ab2e152..94a7fd93 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -1,38 +1,55 @@ *** Settings *** -Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Attribute From A Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 204 -${attribute_id}= fuelLevel - -*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE -015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId - false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attribute From A Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel -015_01_02_Delete an attribute from a temporal representation of an entity with datasetId - false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld +*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE +015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId + false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId + false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld 015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll - true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld + true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld + *** Keywords *** Delete Attribute From A Temporal Entity - [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties [Tags] tea-delete 5_6_13 + [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + ${response}= Delete Attribute From Temporal Entity + ... ${temporal_entity_representation_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${datasetId} + ... ${deleteAll} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 36c975e3..be86794d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -1,40 +1,53 @@ *** Settings *** -Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity -Test Template Delete attribute from temporal entity with unknow entity/attribute id - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-temporal-representation-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id - ${EMPTY} speed +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Delete attribute from temporal entity with unknow entity/attribute id + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld -015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id - invalidId speed +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id + ${EMPTY} speed +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id + invalidId speed 015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id - ${valid_temporal_entity_id} invalid(Name + ${valid_temporal_entity_id} invalid(Name + *** Keywords *** Delete attribute from temporal entity with unknow entity/attribute id - [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id [Tags] tea-delete 5_6_13 - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false + [Arguments] ${entity_id} ${attribute_id} + ${response}= Delete Attribute From Temporal Entity + ... ${entity_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${EMPTY} + ... false Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${valid_temporal_entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} Set Suite Variable ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 5a13f3cb..65683224 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Test Template Delete Attribute - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist - ${unknown_temporal_entity_id} fuelLevel +Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist + ${unknown_temporal_entity_id} fuelLevel 015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute - ${valid_temporal_entity_id} notExistingAttribute + ${valid_temporal_entity_id} notExistingAttribute + *** Keywords *** Delete Attribute - [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId [Tags] tea-delete 5_6_13 - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${valid_temporal_entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} + ${response}= Delete Attribute From Temporal Entity + ... ${entity_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${EMPTY} + ... false + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} 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 b0b0ed18..ccfbb73a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -1,29 +1,48 @@ *** Settings *** -Documentation Check that you can delete an attribute instance in temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an attribute instance in temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${attributeId}= speed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld + *** Test Cases *** 017_01_Delete an attribute instance in temporal representation of an entity [Documentation] Check that you 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} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${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']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 3f71940b..357fcf5f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -1,47 +1,60 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity -Test Template Delete attribute instance - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid - ${temporal_entity_representation_id} speed invalidId +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Delete attribute instance -017_02_04_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name - ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 + + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId +017_02_04_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} 017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not present - ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + *** Keywords *** Delete attribute instance - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right [Tags] tea-instance-delete 5_6_15 - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Delete Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} 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} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} 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 4aadafe9..d3f4d2bd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -1,42 +1,57 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Test Template Delete Attribute Instance - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found - ${unknown_temporal_entity_id} speed ${valid_instanceId} +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute Instance + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 -017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found - ${temporal_entity_representation_id} speed2 ${valid_instanceId} +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} 017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found - ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + *** Keywords *** Delete Attribute Instance - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] tea-instance-delete 5_6_15 - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Delete Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id ${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} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index f75abc6c..10f330e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -1,15 +1,18 @@ *** Settings *** -Documentation Check that you can modify an attribute instance in temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +Documentation Check that you can modify an attribute instance in temporal representation of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld ${expectation_filename}= vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld -${attributeId}= speed +${attributeId}= speed + *** Test Cases *** 016_01_Modify attribute instance in temporal representation of an entity @@ -18,22 +21,41 @@ ${attributeId}= speed ${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} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId_before_update}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId_before_update} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_representation_id} + ... ${attributeId} + ... ${instanceId_before_update} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId_after_update}= Set Variable ${response['body']['speed'][0]['instanceId']} - Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} + Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - ${ignored_attributes}= Create List instanceId @context modifiedAt + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context modifiedAt Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index 2bfdfe95..c2c37f6b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -1,51 +1,64 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity -Test Template Modify Attribute Instance Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_02_01_modify attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -016_02_02_modify attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -016_02_03_modify attribute instance in temporal representation of an entity if the instance id is not valid - ${temporal_entity_representation_id} speed invalidId +Suite Setup Create Id +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity -016_02_04_modify attribute instance in temporal representation of an entity if the instance id is not present - ${temporal_entity_representation_id} speed ${EMPTY} -016_02_05_modify attribute instance in temporal representation of an entity if the attribute name is not a valid name - ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_modify attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} +016_02_02_modify attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} +016_02_03_modify attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId +016_02_04_modify attribute instance in temporal representation of an entity if the instance id is not present + ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_modify attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} 016_02_06_modify attribute instance in temporal representation of an entity if the attribute name is not present - ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + *** Keywords *** Modify Attribute Instance Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right [Tags] tea-partial-update 5_6_14 - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Create Id ${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} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 168d4040..cd0c5f3f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -1,44 +1,60 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity -Test Template Modify Attribute Instance Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld -${status_code}= 404 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_03_01_modify attribute instance in temporal representation of an entity if the entity with given id is not found - ${unknown_temporal_entity_id} speed ${valid_instanceId} +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +${status_code}= 404 -016_03_02_modify attribute instance in temporal representation of an entity if the target attribute is not found - ${temporal_entity_representation_id} speed2 ${valid_instanceId} +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_modify attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} +016_03_02_modify attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} 016_03_03_modify attribute instance in temporal representation of an entity if the target attribute instance is not found - ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + *** Keywords *** Modify Attribute Instance Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] tea-partial-update 5_6_14 - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Create Id ${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} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 3670536a..24f69dd4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that you can create a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_expectation_file_path}= subscriptions/expectations/subscription-028-01-expectation.jsonld -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_expectation_file_path}= subscriptions/expectations/subscription-028-01-expectation.jsonld *** Test Cases *** Create Subscription @@ -16,6 +19,9 @@ Create Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Created Resource Set To ${expected_subscription} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index a4a848a2..6fdab2c6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Subscription With Invalid Request +Documentation Check that you cannot create a subscription with an invalid request + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Subscription With Invalid Request -*** Test Cases *** FILENAME EXPECTED_STATUS -028_02_01_InvalidJson - subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +*** Test Cases *** FILENAME EXPECTED_STATUS +028_02_01_InvalidJson + subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 028_02_02_EmptyJson - subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Create Subscription With Invalid Request - [Arguments] ${filename} ${expected_status} [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 + [Arguments] ${filename} ${expected_status} Create Subscription From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${expected_status} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${expected_status} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index 92b40f77..b2d0a297 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -1,26 +1,35 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid/empty id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Subscription With Invalid/Empty Id +Documentation Check that you cannot create a subscription with an invalid/empty id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Subscription With Invalid/Empty Id + *** Variables *** -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + *** Test Cases *** ID 028_03_01_InvalidId - invalidId + invalidId +028_03_02_EmptyId ${EMPTY} -028_03_02_EmptyId ${EMPTY} *** Keywords *** Create Subscription With Invalid/Empty Id - [Arguments] ${subscription_id} [Documentation] Check that you cannot create a subscription with an invalid/empty id [Tags] sub-create 5_8_1 - ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${subscription_id} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index d6ab2b2d..6683c91b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -1,21 +1,29 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a subscription with an existing id -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} 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} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 38ac89bb..4c86e30a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Delete Subscription With Non present Or Invalid Id +Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Delete Subscription With Non present Or Invalid Id + *** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-delete 5_8_5 +NotPresentId [Tags] sub-delete 5_8_5 + ${EMPTY} +InvalidId [Tags] sub-delete 5_8_5 + InvalidUri -InvalidId InvalidUri - [Tags] sub-delete 5_8_5 *** Keywords *** Delete Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Delete Subscription ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index b46d3c8e..930dbf02 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -1,13 +1,17 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + + +*** Test Cases *** Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-delete 5_8_5 Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 4b7f1243..f6ded38a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can delete a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can delete a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + + +*** Test Cases *** Delete Subscription [Documentation] Check that you can delete a subscription [Tags] sub-delete 5_8_5 @@ -19,6 +23,7 @@ Delete Subscription Retrieve Subscription ${subscription_id} Check SUT Not Containing Resource + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index dc79f31e..c366b8b6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -1,24 +1,50 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +Documentation Check that a notification is only sent if and only if the status is active + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is only sent if status is active + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 046_01 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -35,28 +61,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${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} - - -*** Test Cases *** -Check that a notification is only sent if status is active - [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_11_7 046_01 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index df35844b..a13e7530 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -1,23 +1,54 @@ *** Settings *** -Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld +Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** +Check that a notification is sent on the timeInterval + [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. + [Tags] sub-notification 5_11_7 046_02 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -26,7 +57,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -40,26 +71,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - - -*** Test Case *** -Check that a notification is sent on the timeInterval - [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. - [Tags] sub-notification 5_11_7 046_02 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - ${notification}= Wait for notification timeout=${15} - Output ${notification} - - ${notification}= Wait for notification timeout=${15} - Output ${notification} - - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index cb761040..bef47b8a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -1,23 +1,50 @@ *** Settings *** -Documentation A notification with all subscribed Entities will be included if query or geoquery are not defined. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld +Documentation A notification with all subscribed Entities will be included if query or geoquery are not defined. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** +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_11_7 046_03 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -26,7 +53,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -40,24 +67,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -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_11_7 046_03 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index a027eb05..8232dd58 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -1,25 +1,51 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** +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 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 046_04 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -28,7 +54,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -42,26 +68,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -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 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 046_04 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] - Should be Equal Eiffel Tower ${notification}[data][0][name][value] - - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index a2e79d68..9921e2d1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -1,25 +1,52 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** +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 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 046_05 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -28,7 +55,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -42,22 +69,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -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 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 046_05 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index ed4ca9b7..4b7841ce 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -1,24 +1,46 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Server And Subscriptions -Suite Teardown Delete Server And Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-location-attribute.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Server And Subscriptions +Suite Teardown Delete Server And Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-location-attribute.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent with all matching entities + [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. + [Tags] sub-notification 5_11_7 046_06 + ${entity_building}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + *** Keywords *** Setup Server And Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} @@ -29,20 +51,3 @@ Delete Server And Subscriptions Delete Subscription ${subscription_id} Delete Entity by Id Returning Response ${entity_id} Stop Local Server - -*** Test Case *** -Check that a notification is sent with all matching entities - [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. - [Tags] sub-notification 5_11_7 046_06 - ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Should be Equal ${entity_id} ${notification}[data][0][id] - - - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 7409fd3a..7638041a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -1,108 +1,110 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${subscription_payload_file_path_watchedAttributes}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld -${subscription_payload_file_path_default_context}= subscriptions/subscription-building-entities-active-default-context.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +Documentation Check that a notification is only sent if and only if the status is active -*** Keywords *** -Setup Initial Subscriptions - [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_path} ${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} - Set Suite Variable ${subscription_id} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Delete Initial Subscriptions - Delete Subscription ${subscription_id} +Suite Setup Before Test +Suite Teardown After Test -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 Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path_watchedAttributes} subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +${subscription_payload_file_path_default_context} subscriptions/subscription-building-entities-active-default-context.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${date_format} %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ -After Test - Stop Local Server *** Test Cases *** Check notification structure - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above [Tags] sub-notification 5_8_6 046_07_01 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + + ${notification}= Wait for notification + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check correct attributes are included - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). [Tags] sub-notification 5_8_6 046_07_02 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + + ${notification}= Wait for notification + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] airQualityLevel - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check URI expansion is observed - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). [Tags] sub-notification 5_8_6 046_07_03 Add Initial Entity - Sleep 1s - Setup Initial Subscriptions ${subscription_payload_file_path_default_context} + Sleep 1s + Setup Initial Subscriptions ${subscription_payload_file_path_default_context} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification + + ${notification}= Wait for notification Output ${notification} - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data +*** Keywords *** +Setup Initial Subscriptions + [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_path} + ... ${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} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +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 Fixture Data + Delete Initial Subscriptions + Delete Initial Entity + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 365dc57f..b7c4efec 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -1,63 +1,37 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld +Documentation Check that a notification is only sent if and only if the status is active -*** Keywords *** -Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${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} - Set Suite Variable ${subscription_id} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Delete Initial Subscriptions - Delete Subscription ${subscription_id} +Suite Setup Before Test +Suite Teardown After Test -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} +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld -Delete Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -After Test - Stop Local Server - - -*** Test Case *** +*** Test Cases *** Check that a notification is sent with all attributes - [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included [Tags] sub-notification 5_8_6 046_08_01 - + Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions - + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - + ${notification}= Wait for notification ${5} - Output ${notification} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -67,36 +41,67 @@ Check that a notification is sent with all attributes Dictionary Should Contain Key ${notification}[data][0] almostFull Dictionary Should Contain Key ${notification}[data][0] airQualityLevel Dictionary Should Contain Key ${notification}[data][0] subCategory - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check that a notification is sent with all attributes in simplified format - [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided [Tags] sub-notification 5_8_6 046_08_02 - + Add Initial Entity ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Update Value To Json ${subscription_payload} $..notification['format'] keyValues + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} + ${subscription_payload}= Update Value To Json + ... ${subscription_payload} + ... $..notification['format'] + ... keyValues ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty - Should Be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal Eiffel Tower ${notification}[data][0][name] - [Teardown] Delete Fixture Data + Should Be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal Eiffel Tower ${notification}[data][0][name] + [Teardown] Delete Fixture Data - +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +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 Fixture Data + Delete Initial Subscriptions + Delete Initial Entity +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} +After Test + Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 52c9357c..94f38d3f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -1,27 +1,45 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent to the endpoint + [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info 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_11_7 046_09 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -38,24 +56,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${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} - -*** Test Cases *** -Check that a notification is sent to the endpoint - [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info 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_11_7 046_09 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 04828132..8b91cbdb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -1,28 +1,56 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-default.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${expected_header_links}= <${ngsild_test_suite_context}>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-default.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify +${expected_header_links} <${ngsild_test_suite_context}>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" + + +*** Test Cases *** +Check that a notification is JSON + [Documentation] The Notification content shall be JSON by default + [Tags] sub-notification 5_11_7 046_10 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait For Request timeout=${10} + Reply By 200 + + ${notification_headers}= Get Request Headers + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Contain Item ${notification_headers_dict} Link ${expected_header_links} + + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification}= Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Not Contain Key ${notification}[data][0] @context + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -39,33 +67,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${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} - -*** Test Cases *** -Check that a notification is JSON - [Documentation] The Notification content shall be JSON by default - [Tags] sub-notification 5_11_7 046_10 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait For Request timeout=${10} - Reply By 200 - - ${notification_headers} = Get Request Headers - ${notification_headers_dict}= Convert To Dictionary ${notification_headers} - Dictionary Should Contain Item ${notification_headers_dict} Link ${expected_header_links} - - ${notification_payload}= Get Request Body - # json.loads parses the payload as json. It fails if the payload is malformed - ${notification} Evaluate json.loads('''${notification_payload}''') json - Dictionary Should Not Contain Key ${notification}[data][0] @context - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index f17154bc..3867b044 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -1,29 +1,55 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${date_format}= %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ + + +*** Test Cases *** +Check that timesSent is increased by one + [Documentation] The notification.timesSent member shall be incremented by one. + [Tags] sub-notification 5_11_7 046_11 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for notification timeout=${10} + + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} + + Dictionary Should Contain Key ${response}[body][notification] timesSent + Should Be Equal ${1} ${response}[body][notification][timesSent] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -40,29 +66,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${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} - -*** Test Cases *** -Check that timesSent is increased by one - [Documentation] The notification.timesSent member shall be incremented by one. - [Tags] sub-notification 5_11_7 046_11 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait for notification timeout=${10} - - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - - Dictionary Should Contain Key ${response}[body][notification] timesSent - Should Be Equal ${1} ${response}[body][notification][timesSent] - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index d32c1f9e..54841c27 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -1,70 +1,47 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -*** Keywords *** -Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${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} - Set Suite Variable ${subscription_id} - -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - NotificationUtils.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} *** Test Cases *** Check that lastNotification is updated - [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. + [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_11_7 046_12 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for notification timeout=${10} - - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} + + ${notification_info}= Get Value From Json ${response} $.body.notification + Output ${notification_info} Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal ok ${notification_info}[0][status] + Should Be Equal ok ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastNotification ${is_date}= Is Date ${notification_info}[0][lastNotification] ${date_format} @@ -76,3 +53,33 @@ Check that lastNotification is updated ${is_date_with_millis}= Is Date ${notification_info}[0][lastSuccess] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Before Test + NotificationUtils.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} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index aa250ef3..3027535b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -1,54 +1,62 @@ *** Settings *** -Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld - -*** Test Case *** +Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** Check that lastFailure and status are updated if a notification could not be sent - [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed + [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed [Tags] sub-notification 5_11_7 046_13 @{expected_notification_data_entities}= Create List Building Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Sleep 10s + Sleep 10s - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response} $.body.notification + Output ${notification_info} Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal failed ${notification_info}[0][status] + Should Be Equal failed ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastFailure ${is_date}= Is Date ${notification_info}[0][lastFailure] ${date_format} ${is_date_with_millis}= Is Date ${notification_info}[0][lastFailure] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} + *** Keywords *** 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 Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscription - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 4b6b5cff..b4601190 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -1,27 +1,55 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-accept-jsonld.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-accept-jsonld.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent as JSON-LD + [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' + [Tags] sub-notification 5_11_7 046_14 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait For Request timeout=${10} + Reply By 200 + + ${notification_headers}= Get Request Headers + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Not Contain Key ${notification_headers_dict} Link + + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification}= Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Contain Key ${notification}[data][0] @context + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${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} Set Suite Variable ${subscription_id} @@ -38,34 +66,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${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} - -*** Test Cases *** -Check that a notification is sent as JSON-LD - [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' - [Tags] sub-notification 5_11_7 046_14 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait For Request timeout=${10} - Reply By 200 - - ${notification_headers} = Get Request Headers - ${notification_headers_dict}= Convert To Dictionary ${notification_headers} - Dictionary Should Not Contain Key ${notification_headers_dict} Link - - ${notification_payload}= Get Request Body - # json.loads parses the payload as json. It fails if the payload is malformed - ${notification} Evaluate json.loads('''${notification_payload}''') json - Dictionary Should Contain Key ${notification}[data][0] @context - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index afd183c1..124aac46 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -1,35 +1,54 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json - -*** Test Case *** +Documentation Check that you can query a list of subscriptions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json + + +*** Test Cases *** Query Subscriptions [Documentation] Check that you can query a list of subscriptions [Tags] sub-query 5_8_4 Query Subscriptions context=${ngsild_test_suite_context} - @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} ${third_subscription_id} + @{subscription_ids}= Create List + ... ${first_subscription_id} + ... ${second_subscription_id} + ... ${third_subscription_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + Check Response Body Containing List Containing Subscription elements + ... ${expectation_file_path} + ... ${subscription_ids} + *** 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 ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${first_subscription_id} + ... ${first_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${second_subscription_id} + ... ${second_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + 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} Set Suite Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index ab108f6b..3cd655f2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -1,36 +1,43 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld - -*** Test Cases *** LIMIT OFFSET EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${1} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] sub-query 5_8_4 +Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Query Subscriptions With Limit And Page Parameters + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -Query Last Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] sub-query 5_8_4 +*** Test Cases *** LIMIT OFFSET EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] sub-query 5_8_4 + ${1} ${1} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription + [Tags] sub-query 5_8_4 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${0} ${3} ${EMPTY} ${EMPTY} - [Tags] sub-query 5_8_4 + [Tags] sub-query 5_8_4 + ${15} ${0} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place - Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} offset=${offset} accept=${CONTENT_TYPE_LD_JSON} + [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} + Query Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + ... offset=${offset} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +46,18 @@ 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 ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${first_subscription_id} + ... ${first_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${second_subscription_id} + ... ${second_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + 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} Set Suite Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 29d83423..5527f34a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -1,18 +1,24 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription if the subscription Id is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Retrieve Subscription With Non present Or Invalid Id +Documentation Check that you cannot retrieve a subscription if the subscription Id is not a valid URI, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Retrieve Subscription With Non present Or Invalid Id + *** Test Cases *** id -InvalidId InvalidUri - [Tags] sub-retrieve 5_8_3 +InvalidId [Tags] sub-retrieve 5_8_3 + InvalidUri + *** Keywords *** Retrieve Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Retrieve Subscription ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 3eef3269..07f3e914 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -1,13 +1,17 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + + +*** Test Cases *** Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-retrieve 5_8_3 Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 65925913..95f09088 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json + + +*** Test Cases *** Retrieve Subscription [Documentation] Check that you can retrieve a subscription [Tags] sub-retrieve 5_8_3 @@ -19,6 +23,7 @@ Retrieve Subscription Check Response Status Code Set To 200 Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 7fa6d396..b3e29e80 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Subscription With Non present Or Invalid Id +Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -*** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-update 5_8_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Subscription With Non present Or Invalid Id + + +*** Variables *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json -InvalidId InvalidUri - [Tags] sub-update 5_8_2 -*** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +*** Test Cases *** id +NotPresentId [Tags] sub-update 5_8_2 + ${EMPTY} +InvalidId [Tags] sub-update 5_8_2 + InvalidUri + *** Keywords *** Update Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 738478a0..6f036a32 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -1,17 +1,25 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised -*** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] sub-update 5_8_2 - Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Update Subscription + ... urn:ngsi-ld:Subscription:unknowSubscription + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 844a3d6b..de3acfcb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json + + +*** Test Cases *** Update Subscription With Invalid Fragment [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index dfcec456..86093c7c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json + + +*** Test Cases *** Update Subscription With Null Mandatory Properties [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 6d292ebe..c9c78770 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -1,28 +1,41 @@ *** Settings *** -Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json -${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld +Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json +${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld ${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld -*** Test Case *** + +*** Test Cases *** Update Subscription With Term to Uri Expansion [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Body Containing Subscription element ${expected_subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expected_subscription_payload_file_path} + ... ${subscription_id} Retrieve Subscription ${subscription_id} - Check Response Body Containing Subscription element ${expected_expanded_subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expected_expanded_subscription_payload_file_path} + ... ${subscription_id} + *** Keywords *** Setup 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 57b56ab2..0208b267 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -1,28 +1,40 @@ *** Settings *** -Documentation Check that you can update a subcription: The implementation shall modify the target Subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subcription: The implementation shall modify the target Subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Subscription [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 204 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} ${ignored_attributes}= Create List ${status_regex_expr} Check Updated Resource Set To ${subscription} ${ignored_attributes} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index babf73b2..af036480 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -1,24 +1,29 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Activate Paused Subscription With isActive Member -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Activate Paused Subscription With isActive Member + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrue subscriptions/fragments/subscription-isActive-true-update-sample.json - [Tags] sub-update 5_8_2 +ActiveTrue [Tags] sub-update 5_8_2 + subscriptions/fragments/subscription-isActive-true-update-sample.json -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive Member - [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + [Arguments] ${subscription_update_fragment_file_path} Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index aa0b67ee..fa850b10 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -1,25 +1,30 @@ *** Settings *** -Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Activate Paused Subscription With isActive And ExpiresAt Members -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Activate Paused Subscription With isActive And ExpiresAt Members + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH ActiveTrueExpiresAt - subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json - [Tags] sub-update 5_8_2 + [Tags] sub-update 5_8_2 + subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive And ExpiresAt Members - [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" + [Arguments] ${subscription_update_fragment_file_path} Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 51ef9d3f..20d49129 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-false-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-false-update-sample.json + + +*** Test Cases *** Update Subscription Status To Paused [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" [Tags] sub-update 5_8_2 @@ -20,6 +24,7 @@ Update Subscription Status To Paused Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 050ff8c7..ab482072 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path} subscriptions/fragments/subscription-expiresAt-future-update-sample.json + + +*** Test Cases *** Activate Expired Subscription [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" [Tags] sub-update 5_8_2 # Update subscription to expire in 5 seconds - ${now} = Get Current Date time_zone=UTC - ${in_5_seconds} = Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ - ${update_template_fragment}= Load Json From File ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json - ${update_fragment}= Update Value To Json ${update_template_fragment} $..expiresAt ${in_5_seconds} + ${now}= Get Current Date time_zone=UTC + ${in_5_seconds}= Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ + ${update_template_fragment}= Load Json From File + ... ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json + ${update_fragment}= Update Value To Json ${update_template_fragment} $..expiresAt ${in_5_seconds} Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} - Sleep 10s + Sleep 10s Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 40044f5b..5540ede2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json + + +*** Test Cases *** Update Subscription With ExpiresAt In The Past [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index d844d583..5bfbde25 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you can create a context source registration with specific ID and expiration date -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a context source registration with specific ID and expiration date -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld + + +*** Test Cases *** Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date [Tags] csr-create @@ -18,7 +21,10 @@ Create Context Source Registration With Specific Date Expiration Date ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index f3adc17d..8e9d5457 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you can create a context source registration that never expires -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a context source registration that never expires -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires [Tags] csr-create @@ -18,7 +21,10 @@ Create Context Source Registration That Never Expires ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index ae60a499..7176be42 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that when creating a context source registration without specifying an ID -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that when creating a context source registration without specifying an ID -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Without A Sprecified ID [Documentation] Check that when creating a context source registration without specifying an ID [Tags] csr-create @@ -17,7 +20,10 @@ Create Context Source Registration Without A Sprecified ID Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 19e2d2e1..49819d92 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -1,28 +1,34 @@ *** Settings *** -Documentation Check that you cannot create a context source with invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source with invalid content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Cases *** 033_02_01_Create a context source registration with invalid JSON file Create a context source registration with invalid JSON file 033_02_02_Create a context source registration with a different data structure than CsourRegistration data type - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld + Create Context Source With Invalid Content + ... csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld 033_02_03_Create a context source registration with a date in the past - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-past-expiration-sample.jsonld + Create Context Source With Invalid Content + ... csourceRegistrations/context-source-registration-past-expiration-sample.jsonld + *** Keywords *** Create Context Source With Invalid Content - [Arguments] ${filename} [Documentation] Check that you cannot create a context source with invalid content [Tags] csr-create + [Arguments] ${filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} @@ -35,7 +41,9 @@ Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Context Source Registration Using Session + ... ${registration_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 0508f6a6..937d6175 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that you cannot create a context source registration that already exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source registration that already exists + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Cases *** Create a context source registration that already exists diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index bc129106..b5e97371 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -1,24 +1,32 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + Check JSON Value In Response Body + ... ['information']['entities'][0]['type'] + ... https://ngsi-ld-test-suite/context#Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index 1a73a52a..d88f3aa5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index badb665c..5c57a635 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -1,21 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index c4ce1256..8342b16a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -1,24 +1,31 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + Check JSON Value In Response Body + ... ['information']['entities'][0]['type'] + ... https://ngsi-ld-test-suite/context#Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index 6562b0ab..d5a8a0af 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -1,21 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index a789f920..e33532a4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -1,21 +1,29 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} ${ngsild_test_suite_context} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 59679a2a..25b32bf5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you can delete a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete a context source registration by id -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id [Tags] csr-delete diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index eec164b4..657a7240 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -1,26 +1,30 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Context Source +Documentation Check that you cannot delete a context source registration under some conditions -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld -*** Test Case *** INVALID_REGISTRATION_ID -035_02_01_Delete a Context Source Registration if the Id is not present - ${EMPTY} +*** Test Cases *** INVALID_REGISTRATION_ID +035_02_01_Delete a Context Source Registration if the Id is not present + ${EMPTY} 035_02_02_Delete a Context Source Registration if the Id is not a valid URI - invalidURI + invalidURI + *** Keywords *** Delete Context Source - [Arguments] ${invalid_registration_id} [Documentation] Check that you cannot delete a context source registration under some conditions [Tags] csr-delete + [Arguments] ${invalid_registration_id} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index 699983e8..a6ef7d32 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete a context source registration by id if the id is not known to the system -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Delete a context source registration by id [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system [Tags] csr-delete diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index e209fd5e..09b5854a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -1,39 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of entity types - type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of entity types + [Tags] csr-query 5_10_2 + type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} With list of attribute names - attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} + *** Keywords *** Query Context Source Registration - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] + ... ${query_param_name} + ... ${query_param_value} + ... ${expectation_file_path} + ... @{expected_context_source_registration_ids} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${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} Set Suite Variable ${first_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index c1891a09..f49a9bce 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Query Context Source Registrations Without Entity Types and Attribute Names [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index 477257c2..9b0e6584 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -1,29 +1,34 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Invalid Query Param +Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE -Invalid URI id invalidUri - [Tags] csr-query 5_10_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -Invalid Query q invalidQuery - [Tags] csr-query 5_10_2 +Test Template Query Context Source Registration With Invalid Query Param -Invalid GeoQuery georel within - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE +Invalid URI [Tags] csr-query 5_10_2 + id invalidUri +Invalid Query [Tags] csr-query 5_10_2 + q invalidQuery +Invalid GeoQuery [Tags] csr-query 5_10_2 + georel within Invalid Temporal Query - timerel before - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + timerel before + *** Keywords *** Query Context Source Registration With Invalid Query Param - [Arguments] ${query_param_name} ${query_param_value} [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] ${query_param_name} ${query_param_value} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index cb677f78..b6be3201 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -1,29 +1,38 @@ *** Settings *** -Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json + + +*** Test Cases *** Query Context Source Registrations Without Context [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context [Tags] csr-query 5_10_2 Query Context Source Registrations id=${context_source_registration_id} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index 8eb4542a..a272c716 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -1,32 +1,40 @@ *** Settings *** -Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo +Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH -Registration With EntityInfo Matching The Query - csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json - [Tags] csr-query 5_10_2 +*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH +Registration With EntityInfo Matching The Query + [Tags] csr-query 5_10_2 + csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json Registration Without EntityInfo - csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json + *** Keywords *** Query Context Source Registration Matching EntityInfo of RegistrationInfo - [Arguments] ${registration_file_path} ${expectation_file_path} [Documentation] Check that you 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} + ${context_source_registration_payload}= Load Test Sample + ... ${registration_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 162af3ea..c4773448 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -1,38 +1,45 @@ *** Settings *** -Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld - -*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH -Query With Matching Properties And Relationships - name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH +Query With Matching Properties And Relationships + [Tags] csr-query 5_10_2 + name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json Query Without Properties And Relationships - ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + *** Keywords *** Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo - [Arguments] ${attrs_value} ${expectation_file_path} [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo + [Arguments] ${attrs_value} ${expectation_file_path} Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} -*** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index f6114f13..57ff2406 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -1,36 +1,50 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Geoquery -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json - -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} - [Tags] csr-query 5_10_2 - -Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Query Context Source Registration Matching Geoquery + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH +Near Point [Tags] csr-query 5_10_2 + near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} +Within Polygon [Tags] csr-query 5_10_2 + within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} + *** Keywords *** Query Context Source Registration Matching Geoquery - [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... geoproperty=${geoproperty} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index af0bebcb..2300feb7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -1,29 +1,38 @@ *** Settings *** -Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json + + +*** Test Cases *** Query Context Source Registration Without Temporal Query [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} type=Building @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index fa24e095..29718acb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -1,44 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Temporal Query - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld -${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json -${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json - -*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH -Observation Interval With observedAt - ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval -Observation Interval Without timeproperty - ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching Temporal Query + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json +${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json -Mqnagement Interval With createdAt - ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH +Observation Interval With observedAt + [Tags] csr-query 5_10_2 + ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} +Observation Interval Without timeproperty + [Tags] csr-query 5_10_2 + ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} +Mqnagement Interval With createdAt + [Tags] csr-query 5_10_2 + ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} Mqnagement Interval With modifiedAt - ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} + *** Keywords *** Query Context Source Registration Matching Temporal Query - [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} [Documentation] Check that you 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} + ${context_source_registration_payload}= Load Test Sample + ... ${payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building timeproperty=${timeproperty} timerel=before timeAt=2021-08-01T22:00:00Z + 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 Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index 746a3596..b35280c7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -1,46 +1,63 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Query Params -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration With Query Params + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of Entity Ids - id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of Entity Ids + [Tags] csr-query 5_10_2 + id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} With NGSI-LD Query - q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 - + [Tags] csr-query 5_10_2 + q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} With Context Source Filter - csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + *** Keywords *** Query Context Source Registration With Query Params - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] + ... ${query_param_name} + ... ${query_param_value} + ... ${expectation_file_path} + ... @{expected_context_source_registration_ids} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} + ${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} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index d4c124e9..536e6f29 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -1,36 +1,43 @@ *** Settings *** -Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration With Limit And Page Parameters + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csr-query 5_10_2 +*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] csr-query 5_10_2 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" Query Last Subscription - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csr-query 5_10_2 - + [Tags] csr-query 5_10_2 + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Context Source Registration With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} + [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... limit=${limit} + ... page=${page} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +46,15 @@ Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} + ${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} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 07350f65..305f52a2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id +Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id + *** Test Cases *** ID -Not Present Id ${EMPTY} - [Tags] csr-retrieve 5_10_1 +Not Present Id [Tags] csr-retrieve 5_10_1 + ${EMPTY} +Invalid Id [Tags] csr-retrieve 5_10_1 + invalidUri -Invalid Id invalidUri - [Tags] csr-retrieve 5_10_1 *** Keywords *** Retrieve Context Source Registration With A Not Present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI + [Arguments] ${id} Retrieve Context Source Registration ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index 4122014e..a2d3a3dc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Unknown Context Source Registration [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 2e950e84..0d3f3d52 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -1,28 +1,37 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json - -*** Test Case *** +Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + + +*** Test Cases *** Retrieve Context Source Registration With Default Core Context [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expectation_file_path} + ... ${context_source_registration_id} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 54a67562..7e0772f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -1,28 +1,37 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json - -*** Test Case *** +Documentation Check that you can retrieve a Context Source Registration + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json + + +*** Test Cases *** Retrieve Context Source Registration [Documentation] Check that you can retrieve a Context Source Registration [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expectation_file_path} + ... ${context_source_registration_id} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 26d24cfc..867c92fc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -1,38 +1,46 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration -Test Template Check JSON-LD resolution when retrieving a context source registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json -${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json - -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext - ${EMPTY} ${expectation_file_path_expanded} - [Tags] csr-retrieve 6_3_5 +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Check JSON-LD resolution when retrieving a context source registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json +${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + [Tags] csr-retrieve 6_3_5 + ${EMPTY} ${expectation_file_path_expanded} CreationTimeJsonLdContext - ${ngsild_test_suite_context} ${expectation_file_path_compacted} - [Tags] csr-retrieve 6_3_5 + [Tags] csr-retrieve 6_3_5 + ${ngsild_test_suite_context} ${expectation_file_path_compacted} + *** Keywords *** Check JSON-LD resolution when retrieving a context source registration - [Arguments] ${context} ${expected_payload} [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Arguments] ${context} ${expected_payload} Retrieve Context Source Registration ${context_source_registration_id} context=${context} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expected_payload} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expected_payload} + ... ${context_source_registration_id} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 03f9b0da..99a5e74d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -1,25 +1,29 @@ *** Settings *** -Documentation Check that you can update a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Context Source +Documentation Check that you can update a context source registration by id -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: -*** Test Case *** FILENAME UPDATE_FILENAME -034_01_01_Update a context source registration by id - context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld +*** Test Cases *** FILENAME UPDATE_FILENAME +034_01_01_Update a context source registration by id + context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02_Update a context source registration to never expire - context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld + context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld + *** Keywords *** Update Context Source - [Arguments] ${filename} ${update_filename} [Documentation] Check that you can update a context source registration by id [Tags] csr-update + [Arguments] ${filename} ${update_filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} @@ -27,9 +31,15 @@ Update Context Source Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${registration_update_fragment} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index d0979d82..d27708cf 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you cannot update a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld - -*** Test Case *** +Documentation Check that you cannot update a context source registration under some conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld + + +*** Test Cases *** 034_02_01_Update a context source registration by id if the Id is not present Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld @@ -18,7 +22,9 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld 034_02_03_Update a context source registration if the request body is not of the same data type - Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld + Update Context Source + ... ${valid_registration_id} + ... fragments/context-source-registration-different-type-sample.jsonld 034_02_04_Update a context source registration if you attempt to remove a mandatory property Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld @@ -26,18 +32,22 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample 034_02_05_Update a context source registration if the request body is invalid Update a context source registration if the request body is invalid + *** Keywords *** Update Context Source - [Arguments] ${registration_id} ${fragment_filename} [Documentation] Check that you cannot update a context source registration under some conditions [Tags] csr-update + [Arguments] ${registration_id} ${fragment_filename} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${fragment_with_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${valid_registration_id} @@ -50,7 +60,10 @@ Update a context source registration if the request body is invalid ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Context Source Registration Using Session + ... ${registration_id} + ... ${registration_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 7226e5bb..99989cdc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -1,21 +1,27 @@ *** Settings *** -Documentation Check that you cannot update a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration by id if the id is not known to the system -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${fragment_with_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index d742a5f0..3fb74d28 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a minimal context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a minimal context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription [Documentation] Check that you can create a minimal context source registration subscription [Tags] csrsub-create 5_11_2 @@ -18,10 +22,14 @@ Create Context Source Registration Subscription Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions # TODO: Refactor Generate Random Entity Id to Generate Random Test Sample Id diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 71bf9923..210f79f9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -1,15 +1,19 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/HttpUtils.resource -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated -*** Variable *** -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource -*** Test Case *** +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without An Id [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated [Tags] csrsub-create 5_11_2 @@ -19,10 +23,14 @@ Create Context Source Registration Subscription Without An Id Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} Set Suite Variable ${subscription_id} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Delete Created Context Source Registration Subscriptions Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index 0b2665b7..b6eab9b2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without isActive Member [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default [Tags] csrsub-create 5_11_2 @@ -21,6 +25,7 @@ Create Context Source Registration Subscription Without isActive Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index a01812e0..dbcfbc4c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld + + +*** Test Cases *** Create Inactive Context Source Registration Subscription [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" [Tags] csrsub-create 5_11_2 @@ -21,6 +25,7 @@ Create Inactive Context Source Registration Subscription Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 4285348a..672dd68e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription With expiresAt Member [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired [Tags] csrsub-create 5_11_2 @@ -25,6 +29,7 @@ Create Context Source Registration Subscription With expiresAt Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status expired + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index c261b10f..9b4e70a6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without expiresAt Member [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual [Tags] csrsub-create 5_11_2 @@ -23,6 +27,7 @@ Create Context Source Registration Subscription Without expiresAt Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 54ee1c56..544a9785 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Existing Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 409 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index 3a02989b..d9d8adee 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -1,36 +1,40 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Invalid Context Source Registration Subscription +Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILEPATH -WithoutNotification - csourceSubscriptions/subscription-without-notification-sample.jsonld - [Tags] csrsub-create 5_11_2 +Test Template Create Invalid Context Source Registration Subscription -InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld - [Tags] csrsub-create 5_11_2 -InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld - [Tags] csrsub-create 5_11_2 +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= ${EMPTY} + +*** Test Cases *** FILEPATH +WithoutNotification + [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-without-notification-sample.jsonld +InvalidType [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-invalid-type-sample.jsonld +InvalidQuery [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-invalid-query-sample.jsonld EmptyWatchedAttributes - csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld - [Tags] csrsub-create 5_11_2 + [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld + *** Keywords *** Create Invalid Context Source Registration Subscription - [Arguments] ${filepath} [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met + [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 0984a56d..918cfcbd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld + + +*** Test Cases *** Create Expired Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time [Tags] csrsub-create 5_11_2 @@ -16,5 +19,7 @@ Create Expired Context Source Registration Subscription ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 1530113e..e28f93e1 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -1,15 +1,19 @@ *** Settings *** -Documentation Check that you can delete a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions +Documentation Check that you can delete a context source registration subscription -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Delete Context Source Registration Subscription [Documentation] Check that you can delete a context source registration subscription [Tags] csrsub-delete 5_11_6 @@ -18,6 +22,7 @@ Delete Context Source Registration Subscription Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index be7c7c39..e5b30eae 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete a context source registration subscription with an invalid URI -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Delete Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index 20f9e3f0..ff640433 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot delete an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an unknown context source registration subscription -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Delete Unknown Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete an unknown context source registration subscription [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index a5074ed1..fc647951 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -1,35 +1,44 @@ *** Settings *** -Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld - -*** Test Case *** +Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification Periodically And Initially On Subscription [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Wait for notification # Wait for 15 seconds to check if another notification was sent Wait for notification timeout=${15} + *** Keywords *** Setup Initial Context Source Registrations Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index 8501a50c..b8bc7944 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -1,38 +1,53 @@ *** Settings *** -Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json - -*** Test Case *** +Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + + +*** Test Cases *** Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... updated + *** Keywords *** Setup Initial Context Source Registrations Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 920193e0..03b3d264 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -1,35 +1,48 @@ *** Settings *** -Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification With Relevant Information [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} @{expected_notification_data_entities}= Create List Building - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + ... ${expected_notification_data_entities} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index 3c2a98e0..0256572c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification With Compliant Structure [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index da8d40eb..f2647ddd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json - -*** Test Case *** +Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json + + +*** Test Cases *** If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for notification @@ -27,11 +33,14 @@ If A cSourceNotification Is Successfully Sent The Notification Member Shall Be U @{expected_notification_additional_members}= Create List lastNotification lastSuccess Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index e5b04b3a..839a6d0b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json - -*** Test Case *** +Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json + + +*** Test Cases *** If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for no notification @@ -27,6 +33,7 @@ If A cSourceNotification Is Not Successfully Sent The Notification Member Shall @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index 84499db9..368a46cf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -1,45 +1,52 @@ *** Settings *** -Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + *** Test Cases *** FILEPATH PausedSubscription - csourceSubscriptions/fragments/subscription-isActive-update-sample.json - [Tags] csrsub-notification 5_11_7 - + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-isActive-update-sample.json ExpiredSubscription - csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json - [Tags] csrsub-notification 5_11_7 + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json + *** Keywords *** Do Not Receive cSourceNotification If Subscription Status Is Not Active - [Arguments] ${filepath} [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired + [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for no notification -*** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index a895d1e2..0621ea7e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json - -*** Test Case *** +Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... updated + *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index c0c2df16..2a260f89 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json - -*** Test Case *** +Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json + + +*** Test Cases *** Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} noLongerMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... noLongerMatching + *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} + ${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} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 02c52d3b..0e040ee8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Observation Interval [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index e529cd25..92b1867b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -1,39 +1,48 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval -Suite Setup Start Local Server -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Start Local Server +Suite Teardown Delete Created Context Source Registrations +Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld + *** Test Cases *** FILEPATH -CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 +CreatedAt [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +ModifiedAt [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld -ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Matching Context Source Registrations On Management Interval - [Arguments] ${filepath} [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching # Moved here since each test case creates a subscription [Teardown] Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index c2fded9c..bfe09c26 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index e7d7e2a2..16272e2b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index 7e4aeedf..dd53acce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Location [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index a25bbe76..a20cef11 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Location As Default [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index 68aec84d..2677278d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -1,37 +1,40 @@ *** Settings *** -Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Receive cSourceNotification For Newly Matching Context Source Registrations -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Template Receive cSourceNotification For Newly Matching Context Source Registrations + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS -MatchFirstContextSourceRegistration - csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 +*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS +MatchFirstContextSourceRegistration + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} MatchSecondContextSourceRegistration - csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 - + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} MatchBothContextSourceRegistrations - csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} + *** Keywords *** Receive cSourceNotification For Newly Matching Context Source Registrations - [Arguments] ${filepath} @{notification_csr_ids} [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations + [Arguments] ${filepath} @{notification_csr_ids} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching @@ -41,9 +44,15 @@ Setup Initial Context Source Registrations And Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${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} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 714a83e9..2bc98649 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -1,32 +1,43 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registration subscriptions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json + + +*** Test Cases *** Query Context Source Registration Subscriptions [Documentation] Check that you can query context source registration subscriptions [Tags] csrsub-query 5_11_5 Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + Check Response Body Containing List Containing Subscription elements + ... ${expectation_file_path} + ... ${subscription_ids} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${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} Set Suite Variable ${first_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 b4a5dbfb..f2bf0a32 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -1,36 +1,39 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Limit Parameter -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json - -*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER -Query One Subscription - ${1} ${1} - [Tags] csrsub-query 5_11_5 +Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions +Test Template Query Context Source Registration Subscriptions With Limit Parameter + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json -Query Two Subscription - ${2} ${2} - [Tags] csrsub-query 5_11_5 +*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER +Query One Subscription + [Tags] csrsub-query 5_11_5 + ${1} ${1} +Query Two Subscription + [Tags] csrsub-query 5_11_5 + ${2} ${2} Query All Subscriptions - ${15} ${3} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${15} ${3} + *** Keywords *** Query Context Source Registration Subscriptions With Limit Parameter - [Arguments] ${limit} ${expectation_subscription_number} [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + [Arguments] ${limit} ${expectation_subscription_number} Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} @@ -39,9 +42,15 @@ Setup Initial Context Source Registration 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} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample + ... ${second_subscription_payload_file_path} + ... ${second_subscription_id} + ${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} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index e799c423..be5675b3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -1,36 +1,42 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld - -*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csrsub-query 5_11_5 +Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions +Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -Query Last Subscription - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csrsub-query 5_11_5 +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] csrsub-query 5_11_5 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription + [Tags] csrsub-query 5_11_5 + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Context Source Registration Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + Query Context Source Registration Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + ... page=${page} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +45,15 @@ Setup Initial Context Source Registration 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} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample + ... ${second_subscription_payload_file_path} + ... ${second_subscription_id} + ${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} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index 8aaba995..f4a172f6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -1,26 +1,30 @@ *** Settings *** -Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters +Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters -*** Test Cases *** LIMIT PAGE -Invalid Limit ${-5} ${2} - [Tags] csrsub-query 5_11_5 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -Invalid Page ${2} ${-3} - [Tags] csrsub-query 5_11_5 +Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters + +*** Test Cases *** LIMIT PAGE +Invalid Limit [Tags] csrsub-query 5_11_5 + ${-5} ${2} +Invalid Page [Tags] csrsub-query 5_11_5 + ${2} ${-3} Invalid Limit And Page - ${0} ${0} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${0} ${0} + *** Keywords *** Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters - [Arguments] ${limit} ${page} [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters + [Arguments] ${limit} ${page} Query Context Source Registration Subscriptions limit=${limit} page=${page} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 0537a5bb..ba1d842b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscription -Suite Teardown Delete Created Context Source Registration Subscription - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscription +Suite Teardown Delete Created Context Source Registration Subscription + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json + + +*** Test Cases *** Retrieve Context Source Registration Subscription [Documentation] Check that you can retrieve a context source registration subscription [Tags] csrsub-retrieve 5_11_4 @@ -19,6 +23,7 @@ Retrieve Context Source Registration Subscription Check Response Status Code Set To 200 Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + *** Keywords *** Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index 758c6eb5..8e4a6855 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Context Source Registration Subscription With An Invalid Id [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index d55be566..fb7d52ce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Unknown Context Source Registration Subscription [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 0af8a549..9035fcaa 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can update a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json - -*** Test Case *** +Documentation Check that you can update a context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription [Documentation] Check that you can update a context source registration subscription [Tags] csrsub-update 5_11_3 @@ -19,9 +23,13 @@ Update Context Source Registration Subscription Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Check Response Status Code Set To 204 ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resource Set To ${subscription} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 2875f366..32ba76ba 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -1,18 +1,23 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration subscription with an invalid URI -*** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot update a context source registration subscription with an invalid URI [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index f8c67b83..024b5593 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -1,18 +1,25 @@ *** Settings *** -Documentation Check that you cannot update an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update an unknown context source registration subscription -*** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Unknown Context Source Registration Subscription [Documentation] Check that you cannot update an unknown context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} + Update Context Source Registration Subscription + ... urn:ngsi-ld:Subscription:unknowSubscription + ... ${subscription_update_fragment} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 25e3cffc..3bc78bb0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Context Source Registration Subscription With Invalid Fragment -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Template Update Context Source Registration Subscription With Invalid Fragment + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -*** Test Cases *** FILEPATH -InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json - [Tags] csrsub-update 5_11_3 +*** Test Cases *** FILEPATH +InvalidType [Tags] csrsub-update 5_11_3 + csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json InvalidNotification - csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json - [Tags] csrsub-update 5_11_3 + [Tags] csrsub-update 5_11_3 + csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json + *** Keywords *** Update Context Source Registration Subscription With Invalid Fragment - [Arguments] ${filepath} [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 + [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index 19696f85..7d184f53 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -1,25 +1,34 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json - -*** Test Case *** +Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription With Invalid JSON Fragment [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) [Tags] csrsub-update 5_11_3 - Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} + Update Context Source Registration Subscription From File + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_INVALID_REQUEST} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_INVALID_REQUEST} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/requirements.txt b/requirements.txt index 516a6e77..05c7c182 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ robotframework-requests==0.9.4 deepdiff==6.3.0 robotframework-httpctrl==0.3.1 robotframework-metrics==3.3.1 - +robotframework-tidy==4.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fe594ea9..6129af75 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -1,906 +1,1468 @@ *** Settings *** -Variables ./variables.py +Variables ./variables.py +Library REST ${url} +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library JSONLibrary -Library REST ${url} -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library JSONLibrary *** Variables *** -${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create -${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert -${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update -${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete -&{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} -${ENTITIES_ENDPOINT_PATH} entities/ -${ENTITIES_TYPES_ENDPOINT_PATH} types -${ATTRIBUTES_ENDPOINT_PATH} attributes -${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query -${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities -${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations -${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations -${SUBSCRIPTION_ENDPOINT_PATH} subscriptions/ +${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create +${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert +${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update +${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete +&{BATCH_OPERATION_ENDPOINT_MAPPING} +... create=${BATCH_CREATE_ENDPOINT_PATH} +... upsert=${BATCH_UPSERT_ENDPOINT_PATH} +... update=${BATCH_UPDATE_ENDPOINT_PATH} +... delete=${BATCH_DELETE_ENDPOINT_PATH} +${ENTITIES_ENDPOINT_PATH} entities/ +${ENTITIES_TYPES_ENDPOINT_PATH} types +${ATTRIBUTES_ENDPOINT_PATH} attributes +${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query +${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities +${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations +${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations +${SUBSCRIPTION_ENDPOINT_PATH} subscriptions/ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions -${CONTENT_TYPE_JSON} application/json -${CONTENT_TYPE_LD_JSON} application/ld+json -${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json +${CONTENT_TYPE_JSON} application/json +${CONTENT_TYPE_LD_JSON} application/ld+json +${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json -${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists -${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable + +${response} ${EMPTY} -${response} *** Keywords *** Delete Entity by Id Returning Response - [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response - [return] ${response} + [Arguments] ${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} + Output request + Output response + RETURN ${response} Delete Entity by Id - [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + [Arguments] ${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} + Output request + Output response Query Entity - [Arguments] ${id} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${accept_length} = Get Length ${accept} - ${options_length} = Get Length ${options} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} - ${request}= Output request - Output response - Set Test Variable ${response} - [return] ${request} ${response} + [Arguments] + ... ${id} + ... ${accept}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${context}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${options}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${accept_length}= Get Length ${accept} + ${options_length}= Get Length ${options} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF ${accept_length}>0 + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} + ${request}= Output request + Output response + Set Test Variable ${response} + RETURN ${request} ${response} Query Entities - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${georel}=${EMPTY} ${coordinates}=${EMPTY} ${geometry}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${accept_length} = Get Length ${accept} - ${options_length} = Get Length ${options} - ${entity_ids_length} = Get Length ${entity_ids} - ${entity_types_length} = Get Length ${entity_types} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + [Arguments] + ... ${entity_ids}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${accept}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${context}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${options}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geometry}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${accept_length}= Get Length ${accept} + ${options_length}= Get Length ${options} + ${entity_ids_length}= Get Length ${entity_ids} + ${entity_types_length}= Get Length ${entity_types} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF ${accept_length}>0 + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Query Entities Via POST - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} ${attrs}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${geoproperty}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - ${entity_ids_length} = Get Length ${entity_ids} - ${entity_types_length} = Get Length ${entity_types} - ${attrs_length} = Get Length ${attrs} - Set To Dictionary ${headers} Content-Type ${content_type} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + [Arguments] + ... ${entity_ids}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${attrs}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${geoproperty}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${entity_ids_length}= Get Length ${entity_ids} + ${entity_types_length}= Get Length ${entity_types} + ${attrs_length}= Get Length ${attrs} + Set To Dictionary ${headers} Content-Type ${content_type} + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END ${response}= REST.POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} - Output request - Output response - [return] ${response} + Output request + Output response + RETURN ${response} Retrieve Entity by Id - [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} - Output request - Output response + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} + Output request + Output response Set Test Variable ${response} Create Entity Selecting Content Type - [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='${EMPTY}' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - ${request}= Output request - Output response - [return] ${request} ${response} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='${EMPTY}' + Set To Dictionary ${headers} Accept=${accept} + END + IF '${context}'!='${EMPTY}' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + ${request}= Output request + Output response + RETURN ${request} ${response} Append Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.POST + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Entity Attributes With Parameters - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} - &{headers}= Create Dictionary Content-Type=${content_type} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} + &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.POST + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} + [Arguments] ${id} ${filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ params=options=${options} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... params=options=${options} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Update Entity Attributes Using Session - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} Update Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.PATCH + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON} - Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - @{params}= Create List - Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} - Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} - ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON} + IF '${context}'!='${EMPTY}' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + @{params}= Create List + IF '${datasetId}'!='' + Append To List ${params} datasetId=${datasetId} + END + IF '${deleteAll}'!='' + Append To List ${params} deleteAll=${deleteAll} + END + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= REST.DELETE + ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} + ... headers=${headers} + Output request + Output response + RETURN ${response} Partial Update Entity Attributes - [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + [Arguments] + ... ${entityId} + ... ${attributeId} + ... ${fragment_filename} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.PATCH + ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Types - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} - Output request - Output response + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${details} Set To Dictionary ${params} details=${details} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Entity Type - [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Attributes - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${details} Set To Dictionary ${params} details=${details} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Attribute - [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Create Context Source Registration With Return - [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${context} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} - ${request}= Output request - Output response - [return] ${request} ${response} + [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept=${context} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} + ${request}= Output request + Output response + RETURN ${request} ${response} Create Context Source Registration Using Session - [Arguments] ${filename} ${content_type} + [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + RETURN ${response} Update Context Source Registration With Return - [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} - ${request}= Output request - Output response - [return] ${response} + [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... body=${fragment} + ... headers=${headers} + ${request}= Output request + Output response + RETURN ${response} Update Context Source Registration Using Session - [Arguments] ${registration_id} ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any - Output request - Output response - [return] ${response} + [Arguments] ${registration_id} ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session + ... OneRequest + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output request + Output response + RETURN ${response} Delete Context Source Registration With Return - [Arguments] ${registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - Output request - Output response - [return] ${response} + [Arguments] ${registration_id} + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + Output request + Output response + RETURN ${response} Create Entity - [Arguments] ${filename} ${entity_id} + [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - Output request - Output response + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + Output request + Output response Create Or Update Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} - Output request - Output response - [return] ${response} + ${temporal_entity_representation}= Update Value To Json + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ + ... body=${temporal_entity_representation} + ... headers=${headers} + Output request + Output response + RETURN ${response} Create Temporal Representation Of Entity Selecting Content Type Using Session - [Arguments] ${filename} ${content_type} + [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} + RETURN ${response} Append Attribute To Temporal Entity - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Attribute To Temporal Entity Using Session - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} + RETURN ${response} Modify Attribute Instance From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + [Arguments] + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${content_type} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + ${response}= REST.PATCH + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Attribute From Temporal Entity - [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - @{params}= Create List - Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} - Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} - ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${entityId} + ... ${attributeId} + ... ${content_type} + ... ${datasetId} + ... ${deleteAll} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + @{params}= Create List + IF '${datasetId}'!='' + Append To List ${params} datasetId=${datasetId} + END + IF '${deleteAll}'!='' + Append To List ${params} deleteAll=${deleteAll} + END + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= REST.DELETE + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Temporal Representation Of Entity With Returning Response - [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_representation_id} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response + RETURN ${response} Delete Several Temporal Representations Of Entities - [Arguments] @{temporal_entity_representation_ids} + [Arguments] @{temporal_entity_representation_ids} FOR ${temporal_entity_representation_id} IN @{temporal_entity_representation_ids} - Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} END Get Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${accept}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - ${options_length} = Get Length ${options} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} - Output request - Output response - [return] ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${accept}=${EMPTY} + ... ${options}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${options_length}= Get Length ${options} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + ${response}= REST.GET + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... headers=${headers} + ... query=${params} + Output request + Output response + RETURN ${response} Delete Attribute Instance From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} + &{headers}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.DELETE + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... headers=${headers} + Output request + Output response + RETURN ${response} Update Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${attrId} ${instanceId} ${fragment_filename} ${content_type} - ${temporal_entity_fragment}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} body=${temporal_entity_fragment} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${attrId} + ... ${instanceId} + ... ${fragment_filename} + ... ${content_type} + ${temporal_entity_fragment}= Load Json From File + ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.PATCH + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} + ... body=${temporal_entity_fragment} + ... headers=${headers} + Output request + Output response + RETURN ${response} Batch Create Entities - [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Content-Type ${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... @{entities_to_be_created} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${context}=${EMPTY} + ... ${accept}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Upsert Entities - [Arguments] @{entities_to_be_upserted} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_upserted} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... body=@{entities_to_be_upserted} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Update Entities - [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... body=@{entities_to_be_updated} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Delete Entities - [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} - Output request - Output response - Run Keyword If not ${teardown} Set Test Variable ${response} + [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_DELETE_ENDPOINT_PATH} + ... body=@{entities_ids_to_be_deleted} + ... headers=${headers} + Output request + Output response + IF not ${teardown} Set Test Variable ${response} Request Entity From File - [Arguments] ${filename} + [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Batch Request Entities From File - [Arguments] ${batchOperation} ${filename} + [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} - Create Session BatchRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session BatchRequest ${endpoint_url} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} + Create Session BatchRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... BatchRequest + ... ${endpoint_url} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Create Temporal Representation Of Entity - [Arguments] ${filename} ${temporal_entity_representation_id} + [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} - Output request - Output response + ${temporal_entity_representation}= Update Value To Json + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... body=${temporal_entity_representation} + ... headers=${headers} + Output request + Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${options_length} = Get Length ${options} - &{headers}= Create Dictionary - &{params}= Create Dictionary - - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${endTimeAt}'!='' Set To Dictionary ${params} endTimeAt=${endTimeAt} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${attrs}=${EMPTY} + ... ${options}=${EMPTY} + ... ${context}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${endTimeAt}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${options_length}= Get Length ${options} + &{headers}= Create Dictionary + &{params}= Create Dictionary + + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${endTimeAt}'!='' + Set To Dictionary ${params} endTimeAt=${endTimeAt} + END + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + + ${response}= REST.GET + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... headers=${headers} + ... query=${params} + Output request + Output response + Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${entity_types_length} = Get Length ${entity_types} - ${entity_ids_length} = Get Length ${entity_ids} - ${attrs_length} = Get Length ${attrs} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${entity_ids}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${ngsild_query}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${entity_types_length}= Get Length ${entity_types} + ${entity_ids_length}= Get Length ${entity_ids} + ${attrs_length}= Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${ngsild_query}'!='' + Set To Dictionary ${params} q=${ngsild_query} + END + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} Query Temporal Representation Of Entities Via Post - [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Content-Type ${content_type} - Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${content_type} + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} - ${response}= REST.POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} - Output request - Output response - Set Test Variable ${response} + ${response}= REST.POST + ... ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query + ... body=${query_payload} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Delete Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} + [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response Create Context Source Registration - [Arguments] ${context_source_registration_payload} + [Arguments] ${context_source_registration_payload} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${context_source_registration_payload} headers=${headers} - ${request}= Output request - Output response + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... body=${context_source_registration_payload} + ... headers=${headers} + ${request}= Output request + Output response - Set Suite Variable ${request} - Set Suite Variable ${response} + Set Suite Variable ${request} + Set Suite Variable ${response} Update Context Source Registration - [Arguments] ${context_source_registration_id} ${update_fragment} + [Arguments] ${context_source_registration_id} ${update_fragment} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} body=${update_fragment} - Output request - Output response + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... body=${update_fragment} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registrations - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} - Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} - Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - - Set Test Variable ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${id}=${EMPTY} + ... ${type}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${q}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timeproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${page}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${id}'!='' Set To Dictionary ${params} id=${id} + IF '${type}'!='' Set To Dictionary ${params} type=${type} + IF '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + IF '${q}'!='' Set To Dictionary ${params} q=${q} + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${timeproperty}'!='' + Set To Dictionary ${params} timeproperty=${timeproperty} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} Delete Context Source Registration - [Arguments] ${context_source_registration_id} + [Arguments] ${context_source_registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output request - Output response + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + Output request + Output response - Set Suite Variable ${response} + Set Suite Variable ${response} Retrieve Context Source Registration - [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} - Output request - Output response + [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Create Context Source Registration Subscription - [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - ${request}= Output request - Output response + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... body=${subscription_payload} + ... headers=${headers} + ${request}= Output request + Output response - Set Suite Variable ${request} - Set Suite Variable ${response} + Set Suite Variable ${request} + Set Suite Variable ${response} Update Context Source Registration Subscription - [Arguments] ${subscription_id} ${subscription_update_fragment} + [Arguments] ${subscription_id} ${subscription_update_fragment} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} - Output request - Output response + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... body=${subscription_update_fragment} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Context Source Registration Subscription - [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} - - &{headers}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} - Output request - Output response + [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} + + &{headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registration Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... headers=${headers} + ... query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Delete Context Source Registration Subscription - [Arguments] ${subscription_id} + [Arguments] ${subscription_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output request - Output response + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + Output request + Output response - Set Suite Variable ${response} + Set Suite Variable ${response} Update Context Source Registration Subscription From File - [Arguments] ${subscription_id} ${file_path} + [Arguments] ${subscription_id} ${file_path} ${file_content}= Get File ${EXECDIR}/data/${file_path} - Create Session CsrsUpdateRequest ${url} - ${response}= PATCH On Session CsrsUpdateRequest ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} data=${file_content} expected_status=any - Set Test Variable ${response} + Create Session CsrsUpdateRequest ${url} + ${response}= PATCH On Session + ... CsrsUpdateRequest + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... data=${file_content} + ... expected_status=any + Set Test Variable ${response} Create Subscription - [Arguments] ${subscription_id} ${filename_path} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + [Arguments] + ... ${subscription_id} + ... ${filename_path} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} - Output request - Output response - [return] ${response} + ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} + Output request + Output response + RETURN ${response} Create Subscription From Subscription Payload - [Arguments] ${subscription_payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - Output request - Output response - + [Arguments] + ... ${subscription_payload} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + Output request + Output response Create Subscription From File - [Arguments] ${filename} + [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} - Create Session SubscriptionCreateRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session SubscriptionCreateRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... SubscriptionCreateRequest + ... ${SUBSCRIPTION_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Update Subscription - [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + [Arguments] + ... ${subscription_id} + ... ${fragment_filename} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} - ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + ${response}= REST.PATCH + ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... body=${subscription_update_fragment} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Update Subscription With Payload - [Arguments] ${subscription_id} ${payload} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${payload} headers=${headers} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + [Arguments] ${subscription_id} ${payload} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.PATCH + ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... body=${payload} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Delete Subscription - [Arguments] ${subscription_id} - ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - Output request - Output response - Set Suite Variable ${response} - [return] ${response} + [Arguments] ${subscription_id} + ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + Output request + Output response + Set Suite Variable ${response} + RETURN ${response} Query Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${offset}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${offset}'!='' Set To Dictionary ${params} offset=${offset} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${offset}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} - ${request}= Output request - Output response - Set Test Variable ${response} - [return] ${request} ${response} + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} + ${request}= Output request + Output response + Set Test Variable ${response} + RETURN ${request} ${response} Update Context Source Registration Subscription By Selecting Content Type - [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... body=${subscription_update_fragment} + ... headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Types With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Type With Return - [Arguments] ${type} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${type} ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Attributes With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Attribute With Return - [Arguments] ${attribute_name} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${attribute_name} ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response + RETURN ${response} Create Context Source Registration Subscription With Return - [Arguments] ${subscription_payload} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - ${request}= Output request - Output ${response} - [return] ${request} ${response} + [Arguments] ${subscription_payload} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... body=${subscription_payload} + ... headers=${headers} + ${request}= Output request + Output ${response} + RETURN ${request} ${response} Batch Upsert Entities By Selecting Content Type - [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... body=@{entities_to_be_upserted} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Update Entities By Selecting Content Type - [Arguments] @{entities_to_be_updated} ${content_type}=${CONTENT_TYPE_LD_JSON} ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... @{entities_to_be_updated} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... body=@{entities_to_be_updated} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Delete Entities By Selecting Content Type - [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} - Output request - Output response - Run Keyword If not ${teardown} Set Test Variable ${response} - Set Test Variable ${response} + [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_DELETE_ENDPOINT_PATH} + ... body=@{entities_ids_to_be_deleted} + ... headers=${headers} + Output request + Output response + IF not ${teardown} Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registrations With Return - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} - Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} - Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - - [return] ${request} ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${id}=${EMPTY} + ... ${type}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${q}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timeproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${page}=${EMPTY} + ... ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${id}'!='' Set To Dictionary ${params} id=${id} + IF '${type}'!='' Set To Dictionary ${params} type=${type} + IF '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + IF '${q}'!='' Set To Dictionary ${params} q=${q} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${timeproperty}'!='' + Set To Dictionary ${params} timeproperty=${timeproperty} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + RETURN ${request} ${response} + Query Temporal Representation Of Entities With Return - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${entity_types_length} = Get Length ${entity_types} - ${entity_ids_length} = Get Length ${entity_ids} - ${attrs_length} = Get Length ${attrs} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - [return] ${request} ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${entity_ids}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${ngsild_query}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${entity_types_length}= Get Length ${entity_types} + ${entity_ids_length}= Get Length ${entity_ids} + ${attrs_length}= Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${ngsild_query}'!='' + Set To Dictionary ${params} q=${ngsild_query} + END + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + RETURN ${request} ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5f60fae0..b568c6fa 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,351 +1,453 @@ *** Settings *** Library ${EXECDIR}/libraries/assertionUtils.py -Library RequestsLibrary -Library Collections -Library JSONLibrary -Library REST -Library String - -*** Variable *** -${id_regex_expr}= root\\['id'\\] -${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] -${notification_timestamps_regex_expr}= root\\['last.*'\\] -${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] -${context_regex_expr}= root\\['@context'\\] -${status_regex_expr}= root\\['status'\\] +Library RequestsLibrary +Library Collections +Library JSONLibrary +Library REST +Library String + + +*** Variables *** +${id_regex_expr}= root\\['id'\\] +${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] +${notification_timestamps_regex_expr}= root\\['last.*'\\] +${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] +${context_regex_expr}= root\\['@context'\\] +${status_regex_expr}= root\\['status'\\] + *** Keywords *** Check Response Status Code - [Arguments] ${expected_status_code} ${response_status_code} - ${response_status_code}= convert to string ${response_status_code} - Should Be Equal ${expected_status_code} ${response_status_code} + [Arguments] ${expected_status_code} ${response_status_code} + ${response_status_code}= convert to string ${response_status_code} + Should Be Equal ${expected_status_code} ${response_status_code} Check Response Status Code Set To - [Arguments] ${expected_status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${expected_status} + [Arguments] ${expected_status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${expected_status} Check RL Response Status Code Set To - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} Check Response Body Containing Array Of URIs set to - [Arguments] @{expected_entities_ids} - Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True + [Arguments] @{expected_entities_ids} + Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True Check Response Body Content - [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} + [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} - Output ${response_body} - Output ${entity_payload} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_payload} ${response_body} ${all_ignored_paths} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} + Output ${response_body} + Output ${entity_payload} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_payload} + ... ${response_body} + ... ${all_ignored_paths} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Headers Containing Content-Type set to - [Arguments] ${response} ${expected_content_type_content} - Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + [Arguments] ${response} ${expected_content_type_content} + Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} Check Response Headers Link Not Empty - [Arguments] ${response} - Should Not Be Empty ${response['headers']['Link']} + [Arguments] ${response} + Should Not Be Empty ${response['headers']['Link']} # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers + Check Response Headers Containing URI set to - [Arguments] ${expected_path} ${expected_entity_id} ${response} + [Arguments] ${expected_path} ${expected_entity_id} ${response} - Run Keyword If 'Location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['Location']} ignore_order=True - Run Keyword If 'location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + IF 'Location' in ${response['headers']} + Should Be Equal + ... ${expected_path}${expected_entity_id} + ... ${response['headers']['Location']} + ... ignore_order=True + END + IF 'location' in ${response['headers']} + Should Be Equal + ... ${expected_path}${expected_entity_id} + ... ${response['headers']['location']} + ... ignore_order=True + END # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers ID Not Empty - [Arguments] ${response} + [Arguments] ${response} - ${location_header}= Set Variable If 'Location' in ${response['headers']} ${response['headers']['Location']} ${response['headers']['location']} - ${id}= Fetch From Right ${location_header} / - Should Not Be Empty ${id} - [return] ${id} + ${location_header}= Set Variable If + ... 'Location' in ${response['headers']} + ... ${response['headers']['Location']} + ... ${response['headers']['location']} + ${id}= Fetch From Right ${location_header} / + Should Not Be Empty ${id} + RETURN ${id} Check Response Body Containing an Attribute set to - [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} - Should Not Be Empty ${response['body']['${expected_attribute_name}']} - Run Keyword If '${expected_attribute_value}'!='' Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} + Should Not Be Empty ${response['body']['${expected_attribute_name}']} + IF '${expected_attribute_value}'!='' + Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + END Check Response Body Details Containing Information Error - [Arguments] ${expected_error_message} - Should be Equal ${expected_error_message} ${response['body']['details']} + [Arguments] ${expected_error_message} + Should be Equal ${expected_error_message} ${response['body']['details']} Check Response Body Containing Batch Operation Result - [Arguments] ${expected_batch_operation_result} - @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success - @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors - @{response_errors}= Get From Dictionary ${response['body']} errors + [Arguments] ${expected_batch_operation_result} + @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success + @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors + @{response_errors}= Get From Dictionary ${response['body']} errors - ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} - ${response_errors_length}= Get Length ${response_errors} + ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} + ${response_errors_length}= Get Length ${response_errors} - Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True - Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} + Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True + Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} FOR ${response_error} IN @{response_errors} - List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} - Should Not Be Empty ${response_error['error']} + List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} + Should Not Be Empty ${response_error['error']} END Check Response Body Containing Entity element - [Arguments] ${expectation_filename} ${entity_id} ${response_body} + [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Entity Elements - [Arguments] ${expectation_filename} ${entities_ids} ${response_body} + [Arguments] ${expectation_filename} ${entities_ids} ${response_body} FOR ${entity_id} IN @{entities_ids} - ${entity}= Get Value From Json ${response_body} $[?(@.id=='${entity_id}')] + ${entity}= Get Value From Json ${response_body} $[?(@.id=='${entity_id}')] Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${entity}[0] END Check Response Body Containing List Containing Entity Elements With Different Types - [Arguments] ${filename} ${entities_representation_ids} ${response_body} + [Arguments] ${filename} ${entities_representation_ids} ${response_body} ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} ${index}= Set Variable 0 FOR ${entity_representation_id} IN @{entities_representation_ids} - ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} + ${entities_representation_payload}= Update Value To Json + ... ${entities_representation_payload} + ... $.[${index}]..id + ... ${entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entities_representation_payload} + ... ${response_body} + ... ${instance_id_regex_expr} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element - [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entity_representation} ${response['body']} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${filename} ${temporal_entity_representation_id} + ${temporal_entity_representation_payload}= Load Json From File + ... ${EXECDIR}/data/temporalEntities/expectations/${filename} + ${temporal_entity_representation}= Update Value To Json + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${temporal_entity_representation} + ... ${response['body']} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements - [Arguments] ${filename} ${temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} + [Arguments] ${filename} ${temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Load Json From File + ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${index}= Set Variable 0 FOR ${temporal_entity_representation_id} IN @{temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} + ${temporal_entities_representation_payload}= Update Value To Json + ... ${temporal_entities_representation_payload} + ... $.[${index}]..id + ... ${temporal_entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entities_representation_payload} ${response['body']} ${instance_id_regex_expr} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${temporal_entities_representation_payload} + ... ${response['body']} + ... ${instance_id_regex_expr} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element - [Arguments] ${expectation_filename} ${subscription_id} + [Arguments] ${expectation_filename} ${subscription_id} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Subscription elements - [Arguments] ${expectation_file_path} ${subscription_ids} + [Arguments] ${expectation_file_path} ${subscription_ids} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${subscription_id} IN @{subscription_ids} - ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} + ${subscription_payload}= Update Value To Json + ... ${subscription_payload} + ... $.[${index}]..id + ... ${subscription_id} ${index}= Evaluate ${index} + 1 END - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} # Since response body can be a json object if it contains one element # A check on the response body type is needed + Check Response Body Containing Number Of Entities - [Arguments] ${expected_entity_type} ${expected_length} + [Arguments] ${expected_entity_type} ${expected_length} - ${response_body_length}= Get Length ${response['body']} - ${is_list}= Run Keyword Evaluate type(${response['body']})==list + ${response_body_length}= Get Length ${response['body']} + ${is_list}= Run Keyword Evaluate type(${response['body']})==list - Run Keyword If ${is_list} Should Be Equal ${response_body_length} ${expected_length} - Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} + IF ${is_list} + Should Be Equal ${response_body_length} ${expected_length} + END + Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} FOR ${index} IN RANGE ${expected_length} - Run Keyword If ${is_list} Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + IF ${is_list} + Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + END END - Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} + Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} Check Response Body Containing Context Source Registration element - [Arguments] ${expectation_filename} ${context_source_registration_id} + [Arguments] ${expectation_filename} ${context_source_registration_id} ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${context_source_registration} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${context_source_registration}= Update Value To Json + ... ${context_source_registration_payload} + ... $..id + ... ${context_source_registration_id} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${context_source_registration} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeList element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_list_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_list_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityType element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeInfo element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_info_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_info_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing AttributeList element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_list_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${attribute_list_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Attribute element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${attribute_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Context Source Registrations elements - [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} + ${expected_context_source_registrations_payload}= Load Json From File + ... ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${expected_context_source_registration_id} IN @{expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} + ${expected_context_source_registrations_payload}= Update Value To Json + ... ${expected_context_source_registrations_payload} + ... $.[${index}]..id + ... ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_context_source_registrations_payload} + ... ${response['body']} + ... ${EMPTY} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request - [Arguments] ${response} ${type} - Should Be Equal ${response['type']} ${type} + [Arguments] ${response} ${type} + Should Be Equal ${response['type']} ${type} Check Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - Should Be Equal ${response['body']['type']} ${type} + [Arguments] ${response} ${type} + Should Be Equal ${response['body']['type']} ${type} Check Response Body Title When Using Session Request - [Arguments] ${response} - Should Not Be Empty ${response['title']} + [Arguments] ${response} + Should Not Be Empty ${response['title']} Check Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - Should Not Be Empty ${response['body']['title']} + [Arguments] ${response} + Should Not Be Empty ${response['body']['title']} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - ${json_response_body}= Set Variable ${response.json()} + [Arguments] ${response} ${type} + ${json_response_body}= Set Variable ${response.json()} - Should Be Equal ${json_response_body['type']} ${type} + Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - ${json_response_body}= Set Variable ${response.json()} - Should Not Be Empty ${json_response_body['title']} + [Arguments] ${response} + ${json_response_body}= Set Variable ${response.json()} + Should Not Be Empty ${json_response_body['title']} Assert response status code - [Arguments] ${code} - Should Be Equal ${response}[status] ${code} + [Arguments] ${code} + Should Be Equal ${response}[status] ${code} Check HTTP Response Status Code Is [Arguments] ${expected_status} ${status}= Convert To Integer ${expected_status} - Console Should Be Equal ${response['status']} ${status} Log Status code validated -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json - ${schema} = Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - Check JSON Value In Response Body - [Arguments] ${json_path_expr} ${value_to_check} - Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} + [Arguments] ${json_path_expr} ${value_to_check} + Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} Check NotificationParams - [Arguments] ${filename} ${expected_additional_members} + [Arguments] ${filename} ${expected_additional_members} ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} - ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_notification} ${response['body']['notification']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_notification} + ... ${response['body']['notification']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} - Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} + Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} END Check Pagination Prev And Next Headers - [Arguments] ${prev_link} ${next_link} - ${expected_links}= Create List ${prev_link} ${next_link} - Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link'].replace(" ", "").split(',')} ${expected_links} ignore_order=True - Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} - Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} + [Arguments] ${prev_link} ${next_link} + ${expected_links}= Create List ${prev_link} ${next_link} + IF '${prev_link}'!='' and '${next_link}'!='' + Lists Should Be Equal + ... ${response['headers']['Link'].replace(" ", "").split(',')} + ... ${expected_links} + ... ignore_order=True + END + IF '${prev_link}'!='' and '${next_link}'=='' + Should Be Equal ${response['headers']['Link']} ${prev_link} + END + IF '${prev_link}'=='' and '${next_link}'!='' + Should Be Equal ${response['headers']['Link']} ${next_link} + END Check Response Body Containing One Subscription element - [Arguments] ${expectation_filename} ${response_body} + [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} - ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing One Registration element - [Arguments] ${expectation_filename} ${response_body} + [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${registration} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${registration} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Resource Set To - [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} + [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_resource} ${response['body']} ${ignored_keys} ${group_by} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_resource} + ... ${response['body']} + ... ${ignored_keys} + ... ${group_by} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Created Resource Set To - [Arguments] ${created_resource} ${ignored_keys}=${None} + [Arguments] ${created_resource} ${ignored_keys}=${None} - Check Resource Set To ${created_resource} ${ignored_keys} + Check Resource Set To ${created_resource} ${ignored_keys} Check Subscription Failed - [Arguments] ${subscription} + [Arguments] ${subscription} Should Be True ${sub} - Check Resource Set To ${created_resource} ${ignored_keys} + Check Resource Set To ${created_resource} ${ignored_keys} Check Created Resources Set To - [Arguments] ${expected_resources} ${ignored_keys}=${None} + [Arguments] ${expected_resources} ${ignored_keys}=${None} - Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id + Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id Check Updated Resource Set To - [Arguments] ${updated_resource} ${ignored_keys}=${None} + [Arguments] ${updated_resource} ${ignored_keys}=${None} - Check Resource Set To ${updated_resource} ${ignored_keys} + Check Resource Set To ${updated_resource} ${ignored_keys} Check Updated Resources Set To - [Arguments] ${updated_resources} ${ignored_keys}=${None} + [Arguments] ${updated_resources} ${ignored_keys}=${None} - Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id + Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id Check SUT Not Containing Resource - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} 404 + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} 404 Check SUT Not Containing Resources - Should Be Empty ${response['body']} - + Should Be Empty ${response['body']} diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index ea8c64a8..7a16edde 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -1,9 +1,9 @@ *** Settings *** -Variables ./variables.py +Variables ./variables.py +Library String -Library String *** Keywords *** Fetch Id From Response Location Header - ${id}= Fetch From Right ${response['headers']['Location']} / - [return] ${id} + ${id}= Fetch From Right ${response['headers']['Location']} / + RETURN ${id} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 0617a816..25114644 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -1,79 +1,97 @@ *** Settings *** -Library String -Library DateTime -Library JSONLibrary -Variables ${EXECDIR}/resources/variables.py +Library String +Library DateTime +Library JSONLibrary +Variables ${EXECDIR}/resources/variables.py -*** Variable *** -${date_format}= %Y-%m-%dT%H:%M:%SZ + +*** Variables *** +${date_format}= %Y-%m-%dT%H:%M:%SZ ${notification_server_url}= http://${notification_server_host}:${notification_server_port}/notify -${context_source_url}= http://${context_source_host}:${context_source_port} +${context_source_url}= http://${context_source_host}:${context_source_port} + *** Keywords *** Load Entity - [Arguments] ${entity_file_name} ${entity_id} + [Arguments] ${entity_file_name} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${entity_file_name} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + RETURN ${entity} - [return] ${entity} Load Test Sample - [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} + [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} ${test_sample_payload}= Load Json From File ${EXECDIR}/data/${test_sample_file_path} - ${test_sample}= Update Value To Json ${test_sample_payload} $..id ${test_sample_id} + ${test_sample}= Update Value To Json ${test_sample_payload} $..id ${test_sample_id} - Run Keyword If '${test_sample_id}'=='' Delete Object From Json ${test_sample} $..id + IF '${test_sample_id}'=='' + Delete Object From Json ${test_sample} $..id + END + RETURN ${test_sample} - [return] ${test_sample} Load Subscription Sample With Reachable Endpoint - [Arguments] ${subscription_file_path} ${subscription_id}=${EMPTY} ${notification_endpoint_uri}=${notification_server_url} + [Arguments] + ... ${subscription_file_path} + ... ${subscription_id}=${EMPTY} + ... ${notification_endpoint_uri}=${notification_server_url} - ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} - ${subscription}= Update Value To Json ${subscription_payload} $..notification['endpoint']['uri'] ${notification_endpoint_uri} + ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} + ${subscription}= Update Value To Json + ... ${subscription_payload} + ... $..notification['endpoint']['uri'] + ... ${notification_endpoint_uri} + RETURN ${subscription} - [return] ${subscription} Set Entity Id In Subscription [Arguments] ${subscription_payload} ${entity_id} - ${dict}= Create Dictionary id=${entity_id} + ${dict}= Create Dictionary id=${entity_id} ${subscription}= Add Object To Json ${subscription_payload} $..entities[0] ${dict} - [Return] ${subscription} + RETURN ${subscription} Load Context Source Registration Sample With Reachable Context Source - [Arguments] ${context_source_registration_file_path} ${context_source_registration_id}=${EMPTY} ${context_source_endpoint_uri}=${context_source_url} + [Arguments] + ... ${context_source_registration_file_path} + ... ${context_source_registration_id}=${EMPTY} + ... ${context_source_endpoint_uri}=${context_source_url} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_file_path} ${context_source_registration_id} - ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..endpoint ${context_source_endpoint_uri} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_file_path} + ... ${context_source_registration_id} + ${context_source_registration}= Update Value To Json + ... ${context_source_registration_payload} + ... $..endpoint + ... ${context_source_endpoint_uri} + RETURN ${context_source_registration} - [return] ${context_source_registration} Remove Entity Type [Arguments] ${entity} - ${invalid_entity}= Delete Object From Json ${entity} $..type + ${invalid_entity}= Delete Object From Json ${entity} $..type + RETURN ${invalid_entity} - [return] ${invalid_entity} Generate Random Entity Id [Arguments] ${id_prefix} - ${random_id}= Generate Random String 16 [NUMBERS] + ${random_id}= Generate Random String 16 [NUMBERS] ${entity_id}= Catenate ${id_prefix}${random_id} + RETURN ${entity_id} - [return] ${entity_id} Create Batch Operation Result - [Arguments] ${success} ${errors} + [Arguments] ${success} ${errors} - &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} + &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} + RETURN &{batch_operation_result} - [return] &{batch_operation_result} Upsert Element In Entity - [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ + [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ - ${updated_entity}= Add Object To Json ${initial_entity} ${jsonPath} ${fragment} - [return] ${updated_entity} + ${updated_entity}= Add Object To Json ${initial_entity} ${jsonPath} ${fragment} + RETURN ${updated_entity} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 8290f67d..2a88bd8e 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -1,31 +1,33 @@ *** Settings *** -Documentation Mock http server for subscriber -Library HttpCtrl.Server -Variables ${EXECDIR}/resources/variables.py +Documentation Mock http server for subscriber + +Library HttpCtrl.Server +Variables ${EXECDIR}/resources/variables.py + *** Keywords *** Start Context Source Mock Server - #Initialize HTTP Client And Server - Start Server ${context_source_host} ${context_source_port} + # Initialize HTTP Client And Server + Start Server ${context_source_host} ${context_source_port} Wait for redirected request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 Wait for redirected failed request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 400 + Reply By 400 Stop Context Source Mock Server - #Terminate HTTP Server + # Terminate HTTP Server Stop Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 43af2820..ac978eba 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -1,86 +1,103 @@ *** Settings *** -Documentation Check Notification Behaviour -Library BuiltIn -Library Collections -Library HttpCtrl.Server -Library ${EXECDIR}/libraries/assertionUtils.py -Library ${EXECDIR}/libraries/dateTimeUtils.py -Variables ${EXECDIR}/resources/variables.py - -*** Variable *** -${notification_type}= ContextSource Notfication -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +Documentation Check Notification Behaviour + +Library BuiltIn +Library Collections +Library HttpCtrl.Server +Library ${EXECDIR}/libraries/assertionUtils.py +Library ${EXECDIR}/libraries/dateTimeUtils.py +Variables ${EXECDIR}/resources/variables.py + + +*** Variables *** +${notification_type} ContextSource Notfication +${date_format} %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ + *** Keywords *** -Start Local Server - [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} - #Initialize HTTP Client And Server - Start Server ${host} ${port} +Start Local Server + [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} + # Initialize HTTP Client And Server + Start Server ${host} ${port} Wait for notification - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json - [Return] ${notification} + ${notification_payload}= Get Request Body + ${notification}= Evaluate json.loads('''${notification_payload}''') json + RETURN ${notification} Wait for notification and validate it - [Arguments] ${expected_subscription_id} ${expected_context_source_registration_ids} ${expected_trigger_reason} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] + ... ${expected_subscription_id} + ... ${expected_context_source_registration_ids} + ... ${expected_trigger_reason} + ... ${expected_notification_data_entities}=${EMPTY} + ... ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json + ${notification_payload}= Get Request Body + ${notification}= Evaluate json.loads('''${notification_payload}''') json ${notification_data_length}= Get length ${notification}[data] ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} ${expected_notification_data_length}= Get length ${expected_context_source_registration_ids} - log ${notification} - Should Be Equal ${notification}[type] ${notification_type} - Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} + log ${notification} + Should Be Equal ${notification}[type] ${notification_type} + Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - Should Be True ${is_date} + Should Be True ${is_date} ${index}= Set Variable 0 FOR ${expected_context_source_registration_id} IN @{expected_context_source_registration_ids} - List Should Contain Value ${expected_context_source_registration_ids} ${notification}[data][${index}][@id] + List Should Contain Value + ... ${expected_context_source_registration_ids} + ... ${notification}[data][${index}][@id] ${index}= Evaluate ${index} + 1 END - Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' - Should Be Equal ${notification}[triggerReason] ${expected_trigger_reason} + Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' + Should Be Equal ${notification}[triggerReason] ${expected_trigger_reason} # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all - Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + IF ${expected_notification_data_entities_length}>0 + Check Notification Data Entities + ... ${notification}[data][0][information] + ... ${expected_notification_data_entities} + END Wait for no notification - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For No Request ${timeout} Check Notification Data Entities - [Arguments] ${notification_data_information} ${expected_notification_data_entities} + [Arguments] ${notification_data_information} ${expected_notification_data_entities} - ${notification_data_entities}= Create List + ${notification_data_entities}= Create List ${index}= Set Variable 0 FOR ${registration_information} IN @{notification_data_information} - Append To List ${notification_data_entities} ${registration_information}[entities][0][type][0] + Append To List ${notification_data_entities} ${registration_information}[entities][0][type][0] END - Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True + Lists Should Be Equal + ... ${expected_notification_data_entities} + ... ${notification_data_entities} + ... ignore_order=True Stop Local Server - #Terminate HTTP Server + # Terminate HTTP Server Stop Server -- GitLab From bda84c5735c384508a54b45e27066b8b810fa62e Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 16 May 2023 12:59:06 +0200 Subject: [PATCH 2/6] feat: finalize integration of Robotidy --- .pre-commit-config.yaml | 6 ++++++ README.md | 37 ++++++++++++++++++++++++++++++++---- pyproject.toml | 6 ++++++ resources/ApiUtils.resource | 9 ++++----- resources/JsonUtils.resource | 7 ------- 5 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..54f26c88 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/MarketSquare/robotframework-tidy + id: robotidy + rev: 4.2.1 + hooks: + - id: robotidy diff --git a/README.md b/README.md index 3c0126f6..5c314cd0 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,38 @@ Browse the base project root folder and execute the following command: Further details on each library can be found in [PyPi](https://pypi.org/) and [Robot Framework Standard Libraries](http://robotframework.org/robotframework/#standard-libraries) +## Run configurations (PyCharm) + +Two sample configurations have been created: + +- one to check if there are syntax or format changes to be done according to Robotidy (`Check Format`) +- one to make the syntax and format changes according to Robotidy (`Format Files`) + +To launch a run configuration, choose one of the two configurations from the Run menu and click on it to run it. + +## Pre commit + +Before each commit, a formatting according to the rules of [Robotidy](https://github.com/MarketSquare/robotframework-tidy) + is done for files with the `.robot` or `.resource` extension. If nothing has been modified, the commit is done normally. + Otherwise, the commit displays an error message with all the modifications made by Robotidy to format the file. Modified + files can then be added to the commit. + +To use it, install `pre-commit` with the following commands (using pip): + +```$ pip install pre-commit``` + +Then install the Git hook scripts: + +```$ pre-commit install``` + +Now, it will run automatically on every commit. + +To manually launch the tool, the following command can be used: + +```$ ./venv/bin/python -m robotidy .``` + +Further details can be found on the [pre-commit](https://pre-commit.com) site. + ## Execute the tests Configure the context broker URL in the resources/variables.py file @@ -91,10 +123,6 @@ A sample report can be seen at https://robotmetrics.netlify.app/# ```$ python3 -m robot.testdoc TP/NGSI-LD api_docs/TestCases.html``` -## Tidy the Test Cases - -```$ python3 -m robot.tidy --recursive TP/NGSI-LD``` - # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) @@ -103,6 +131,7 @@ A sample report can be seen at https://robotmetrics.netlify.app/# * [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary) * [Requests Library](https://github.com/MarketSquare/robotframework-requests) * [Deep Diff](https://github.com/seperman/deepdiff) +* [Robotidy Library ](https://github.com/MarketSquare/robotframework-tidy) # Useful links diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..4e4f899e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[tool.robotidy] +diff = true +configure = [ + "SplitTooLongLine: split_on_every_arg = True" +] + diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 6129af75..fc657dc8 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -13,10 +13,10 @@ ${BATCH_UPSERT_ENDPOINT_PATH} entityOperations ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} -... create=${BATCH_CREATE_ENDPOINT_PATH} -... upsert=${BATCH_UPSERT_ENDPOINT_PATH} -... update=${BATCH_UPDATE_ENDPOINT_PATH} -... delete=${BATCH_DELETE_ENDPOINT_PATH} +... create=${BATCH_CREATE_ENDPOINT_PATH} +... upsert=${BATCH_UPSERT_ENDPOINT_PATH} +... update=${BATCH_UPDATE_ENDPOINT_PATH} +... delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities/ ${ENTITIES_TYPES_ENDPOINT_PATH} types ${ATTRIBUTES_ENDPOINT_PATH} attributes @@ -1401,7 +1401,6 @@ Query Context Source Registrations With Return Output response RETURN ${request} ${response} - Query Temporal Representation Of Entities With Return [Arguments] ... ${context}=${EMPTY} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 25114644..43a3a0ec 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -19,7 +19,6 @@ Load Entity ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} RETURN ${entity} - Load Test Sample [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} @@ -31,7 +30,6 @@ Load Test Sample END RETURN ${test_sample} - Load Subscription Sample With Reachable Endpoint [Arguments] ... ${subscription_file_path} @@ -45,7 +43,6 @@ Load Subscription Sample With Reachable Endpoint ... ${notification_endpoint_uri} RETURN ${subscription} - Set Entity Id In Subscription [Arguments] ${subscription_payload} ${entity_id} ${dict}= Create Dictionary id=${entity_id} @@ -67,14 +64,12 @@ Load Context Source Registration Sample With Reachable Context Source ... ${context_source_endpoint_uri} RETURN ${context_source_registration} - Remove Entity Type [Arguments] ${entity} ${invalid_entity}= Delete Object From Json ${entity} $..type RETURN ${invalid_entity} - Generate Random Entity Id [Arguments] ${id_prefix} @@ -82,14 +77,12 @@ Generate Random Entity Id ${entity_id}= Catenate ${id_prefix}${random_id} RETURN ${entity_id} - Create Batch Operation Result [Arguments] ${success} ${errors} &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} RETURN &{batch_operation_result} - Upsert Element In Entity [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ -- GitLab From 7f008b26f824cd3a4ae22191262e66386ab94482 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 16 May 2023 13:01:39 +0200 Subject: [PATCH 3/6] fix: forgotten run configurations for PyCharm --- .idea/runConfigurations/Check_Format.xml | 24 ++++++++++++++++++++++++ .idea/runConfigurations/Format_Files.xml | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .idea/runConfigurations/Check_Format.xml create mode 100644 .idea/runConfigurations/Format_Files.xml diff --git a/.idea/runConfigurations/Check_Format.xml b/.idea/runConfigurations/Check_Format.xml new file mode 100644 index 00000000..dbdb34d8 --- /dev/null +++ b/.idea/runConfigurations/Check_Format.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Format_Files.xml b/.idea/runConfigurations/Format_Files.xml new file mode 100644 index 00000000..e5c737c2 --- /dev/null +++ b/.idea/runConfigurations/Format_Files.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file -- GitLab From 0a63cc65c9ca14691c4bdfbd09d77b58d6cd6d04 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Tue, 30 May 2023 17:11:15 +0200 Subject: [PATCH 4/6] chore: mainly renaming on functions and in documentation --- TP/NGSI-LD/CommonBehaviours/043.robot | 16 +++--- TP/NGSI-LD/CommonBehaviours/044_02.robot | 4 +- .../RetrieveAvailableAttributes/025_01.robot | 4 +- .../RetrieveAvailableEntityTypes/022_01.robot | 4 +- .../026_01.robot | 4 +- .../023_01.robot | 4 +- .../Entity/RetrieveEntity/018_06.robot | 8 +-- .../CreateBatchOfEntities/003_03.robot | 4 +- .../DeleteBatchOfEntities/006_02.robot | 4 +- .../DeleteBatchOfEntities/006_03.robot | 4 +- .../UpdateBatchOfEntities/005_03.robot | 4 +- .../UpdateBatchOfEntities/005_04.robot | 4 +- .../UpsertBatchOfEntities/004_01.robot | 2 +- .../UpsertBatchOfEntities/004_02.robot | 2 +- .../UpsertBatchOfEntities/004_06.robot | 4 +- .../Entities/CreateEntity/001_02.robot | 4 +- .../009_02.robot | 4 +- .../009_03.robot | 6 +- .../AppendAttributes/014_02.robot | 4 +- .../AppendAttributes/014_03.robot | 4 +- .../DeleteAttribute/015_02.robot | 4 +- .../DeleteAttribute/015_03.robot | 6 +- .../DeleteAttributeInstance/017_02.robot | 4 +- .../DeleteAttributeInstance/017_03.robot | 4 +- .../ModifyAttributeInstance/016_02.robot | 4 +- .../ModifyAttributeInstance/016_03.robot | 4 +- .../CreateSubscription/028_02.robot | 4 +- .../Subscription/Notification/046_02.robot | 2 +- .../Subscription/Notification/046_04.robot | 4 +- .../Subscription/Notification/046_05.robot | 4 +- .../Subscription/Notification/046_06.robot | 2 +- .../Subscription/Notification/046_07.robot | 2 +- .../Subscription/Notification/046_08.robot | 4 +- .../Subscription/Notification/046_12.robot | 2 +- .../Subscription/Notification/046_13.robot | 4 +- .../UpdateSubscription/029_10.robot | 4 +- .../033_01_01.robot | 4 +- .../033_01_02.robot | 4 +- .../033_01_03.robot | 8 +-- .../033_02.robot | 4 +- .../033_03.robot | 4 +- .../033_04.robot | 4 +- .../033_05.robot | 4 +- .../033_06.robot | 4 +- .../033_07.robot | 4 +- .../033_08.robot | 4 +- .../033_09.robot | 4 +- .../035_01.robot | 4 +- .../035_02.robot | 4 +- .../037_02.robot | 4 +- .../037_06.robot | 4 +- .../037_07.robot | 4 +- .../036_01.robot | 4 +- .../036_05.robot | 4 +- .../034_01.robot | 8 +-- .../034_02.robot | 12 ++-- .../034_03.robot | 4 +- .../038_05.robot | 6 +- .../NotificationBehaviour/047_02.robot | 4 +- .../NotificationBehaviour/047_07.robot | 4 +- .../NotificationBehaviour/047_09.robot | 4 +- .../NotificationBehaviour/047_12.robot | 4 +- .../039_04.robot | 4 +- requirements.txt | 1 + resources/ApiUtils.resource | 38 ++++++------- resources/AssertionUtils.resource | 56 +++++++++---------- resources/JsonUtils.resource | 20 +++---- 67 files changed, 197 insertions(+), 196 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index fc06ed83..4d200916 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Documentation Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -20,7 +20,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration *** Test Cases *** 043_01 Create entity - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) + [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type @@ -35,7 +35,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) + [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription) [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -47,7 +47,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) + [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) [Tags] te-create 5_2_2 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type @@ -62,7 +62,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create) [Tags] be-create 5_2_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -78,11 +78,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) + [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) [Tags] csr-create 5_2_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index a7aad16e..475f6508 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -52,8 +52,8 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) [Tags] csr-query 6_3_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Context Source Registrations With Return 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 17bb74b3..86a5d856 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -16,10 +16,10 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext +WithoutJSONLdContext [Tags] ed-attrs 5_7_8 ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json -WithJsonLdContext [Tags] ed-attrs 5_7_8 +WithJSONLdContext [Tags] ed-attrs 5_7_8 ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json 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 22b2d42a..fbf5f397 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -18,10 +18,10 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext +WithoutJSONLdContext [Tags] ed-types 5_7_5 ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json -WithJsonLdContext [Tags] ed-types 5_7_5 +WithJSONLdContext [Tags] ed-types 5_7_5 ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json 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 77ac8a2d..8c63e9f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -16,10 +16,10 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext +WithoutJSONLdContext [Tags] ed-attrs-details 5_7_9 ${EMPTY} types/expectations/attribute-026-01-01-expectation.json -WithJsonLdContext [Tags] ed-attrs-details 5_7_9 +WithJSONLdContext [Tags] ed-attrs-details 5_7_9 ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json 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 3f76ca0e..b4d40c15 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -18,10 +18,10 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext +WithoutJSONLdContext [Tags] ed-types-details 5_7_6 ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json -WithJsonLdContext [Tags] ed-types-details 5_7_6 +WithJSONLdContext [Tags] ed-types-details 5_7_6 ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json 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 1875e2e9..012e4ed6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entity Suite Teardown Delete Created Entity -Test Template Check Json-LD Resolution When retrieving an entity +Test Template Check JSON-LD Resolution When retrieving an entity *** Variables *** @@ -18,16 +18,16 @@ ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-co *** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext +EmptyJSONLdContext [Tags] e-retrieve 6_3_5 ${EMPTY} ${empty_jsonld_expectation_filename} -CreationTimeJsonLdContext +CreationTimeJSONLdContext [Tags] e-retrieve 6_3_5 ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} *** Keywords *** -Check Json-LD Resolution When retrieving an entity +Check JSON-LD Resolution When retrieving an entity [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index afbc5db4..76f41c66 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -8,9 +8,9 @@ Test Template Create Batch Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson [Tags] be-create 5_6_7 +InvalidJSON [Tags] be-create 5_6_7 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -EmptyJson [Tags] be-create 5_6_7 +EmptyJSON [Tags] be-create 5_6_7 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 09e8e652..abe62e7e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -13,8 +13,8 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** -Delete a batch of non existing and existing entities - [Documentation] Check that you can delete a batch of non existing and existing entities +Delete a batch of non-existing and existing entities + [Documentation] Check that you can delete a batch of non-existing and existing entities [Tags] be-delete 5_6_10 ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index c36cc59e..f4bb7917 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -8,9 +8,9 @@ Test Template Batch Delete Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson [Tags] be-delete 5_6_10 +InvalidJSON [Tags] be-delete 5_6_10 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -EmptyJson [Tags] be-delete 5_6_10 +EmptyJSON [Tags] be-delete 5_6_10 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 a11ee112..9cfe8864 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -15,8 +15,8 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship- *** Test Cases *** -Update a batch of non existing and existing entities - [Documentation] Check that you can update a batch of non existing and existing entities +Update a batch of non-existing and existing entities + [Documentation] Check that you can update a batch of non-existing and existing entities [Tags] be-update 5_6_9 ${first_existing_entity}= Load Entity ... building-relationship-of-property-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index e00b0a4e..77c7535c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -8,9 +8,9 @@ Test Template Batch Update Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson [Tags] be-update 5_6_9 +InvalidJSON [Tags] be-update 5_6_9 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -InvalidJsonLd [Tags] be-update 5_6_9 +InvalidJSONLd [Tags] be-update 5_6_9 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 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 71ed7794..7901378a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -26,7 +26,7 @@ EntityWithRelationshipsProperties *** Keywords *** Batch Upsert Entity Scenarios - [Documentation] Check that you can upsert a batch of non existing entities + [Documentation] Check that you can upsert a batch of non-existing entities [Arguments] ${filename} ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} 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 60408778..b41d692c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -28,7 +28,7 @@ EntityWithRelationshipsProperties *** Keywords *** Batch Upsert Non-existing And Existing Entities Scenarios - [Documentation] Check that you can upsert a batch of non existing and existing entities + [Documentation] Check that you can upsert a batch of non-existing and existing entities [Arguments] ${filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 1b8c9cc3..3f4771aa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -8,9 +8,9 @@ Test Template Batch Upsert Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson [Tags] be-upsert 5_6_8 +InvalidJSON [Tags] be-upsert 5_6_8 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -InvalidJsonLd [Tags] be-upsert 5_6_8 +InvalidJSONLd [Tags] be-upsert 5_6_8 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 061bdd72..8cea8652 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -8,9 +8,9 @@ Test Template Create Entity With Invalid Request Scenarios *** Test Cases *** FILENAME ERROR_TYPE -001_02_01_InvalidJson +001_02_01_InvalidJSON invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -001_02_02_EmptyJson +001_02_02_EmptyJSON empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 6c681856..c9c03003 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId +Documentation Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -21,7 +21,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: *** Keywords *** Delete Temporal Entity - [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Documentation] Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId [Tags] te-delete 5_6_16 [Arguments] ${status_code} ${id} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 489df5ea..5f2a3cf7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId +Documentation Check that an error is raised if you delete a temporal entity with a non-existing/invalid EntityId Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -12,8 +12,8 @@ ${status_code}= 404 *** Test Cases *** -009_03 Delete a temporal representation of an entity with a unknown entity id - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing entity id +009_03 Delete a temporal representation of an entity with an unknown entity id + [Documentation] Check that an error is raised if you delete a temporal entity with a non-existing entity id [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index d7ca68d1..3360b677 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content +Documentation Check that an error is raised if you delete a temporal entity with empty/invalid content Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -48,7 +48,7 @@ Add an Attribute To a Temporal Entity From File [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you add a temporal entity attribute with a non existing/invalid EnityId + [Documentation] Check that an error is raised if you add a temporal entity attribute with a non-existing/invalid EntityId [Tags] tea-append 5_6_12 [Arguments] ${id} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 375900cf..2f50f7ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you add an attribute to a non existent entity +Documentation Check that an error is raised if you add an attribute to a non-existent entity Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -15,7 +15,7 @@ ${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you add an attribute to a non existent entity + [Documentation] Check that an error is raised if you add an attribute to a non-existent entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index be86794d..f6d074b4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Documentation Check that an error is raised if you delete an attribute to temporal entity with an unknown/invalid Entity/Attribute Id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -27,7 +27,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Keywords *** Delete attribute from temporal entity with unknow entity/attribute id - [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with an unknown/invalid Entity/Attribute Id [Tags] tea-delete 5_6_13 [Arguments] ${entity_id} ${attribute_id} ${response}= Delete Attribute From Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 65683224..918a4a95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId +Documentation Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -16,7 +16,7 @@ ${status_code}= 404 *** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist +015_03_01_Delete an attribute to a temporal entity if the entity id does not exist ${unknown_temporal_entity_id} fuelLevel 015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute ${valid_temporal_entity_id} notExistingAttribute @@ -24,7 +24,7 @@ ${status_code}= 404 *** Keywords *** Delete Attribute - [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Documentation] Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id [Tags] tea-delete 5_6_13 [Arguments] ${entity_id} ${attribute_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 357fcf5f..4c69535b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -31,7 +31,7 @@ ${status_code}= 400 *** Keywords *** Delete attribute instance - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right [Tags] tea-instance-delete 5_6_15 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${response}= Delete Attribute Instance From Temporal Entity 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 d3f4d2bd..4e663df8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -26,7 +26,7 @@ ${status_code}= 404 *** Keywords *** Delete Attribute Instance - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not found [Tags] tea-instance-delete 5_6_15 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${response}= Delete Attribute Instance From Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index c2c37f6b..133be618 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -34,7 +34,7 @@ ${status_code}= 400 *** Keywords *** Modify Attribute Instance Temporal Entity - [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right [Tags] tea-partial-update 5_6_14 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${response}= Modify Attribute Instance From Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index cd0c5f3f..9c805e2d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -28,7 +28,7 @@ ${status_code}= 404 *** Keywords *** Modify Attribute Instance Temporal Entity - [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not found [Tags] tea-partial-update 5_6_14 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${response}= Modify Attribute Instance From Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index 6fdab2c6..735bf757 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -8,9 +8,9 @@ Test Template Create Subscription With Invalid Request *** Test Cases *** FILENAME EXPECTED_STATUS -028_02_01_InvalidJson +028_02_01_InvalidJSON subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -028_02_02_EmptyJson +028_02_02_EmptyJSON subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index a13e7530..0a9bc524 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." +Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index 8232dd58..bd71d44b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. 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 Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -21,7 +21,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 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 and4.10) the query and geoquery conditions + [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_11_7 046_04 Add Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 9921e2d1..83d3bcdb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. 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 Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -21,7 +21,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** 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 and4.10) the query and geoquery conditions + [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_11_7 046_05 Add Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 4b7841ce..d47618f9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. 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 +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. 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 Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 7638041a..a6c1e607 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -25,7 +25,7 @@ ${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ *** Test Cases *** Check notification structure - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above [Tags] sub-notification 5_8_6 046_07_01 Add Initial Entity Sleep 1s diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index b7c4efec..0c52a261 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -21,7 +21,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** Check that a notification is sent with all attributes - [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included [Tags] sub-notification 5_8_6 046_08_01 Add Initial Entity @@ -53,7 +53,7 @@ Check that a notification is sent with all attributes in simplified format ... ${subscription_payload_file_path} ... ${subscription_id} ... ${notification_server_send_url} - ${subscription_payload}= Update Value To Json + ${subscription_payload}= Update Value To JSON ... ${subscription_payload} ... $..notification['format'] ... keyValues diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 54841c27..44160ead 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -37,7 +37,7 @@ Check that lastNotification is updated ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification + ${notification_info}= Get Value From JSON ${response} $.body.notification Output ${notification_info} Dictionary Should Contain Key ${notification_info}[0] status diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index 3027535b..d3e13671 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed +Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -21,7 +21,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Cases *** Check that lastFailure and status are updated if a notification could not be sent - [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed + [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed" [Tags] sub-notification 5_11_7 046_13 @{expected_notification_data_entities}= Create List Building diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index ab482072..1d09768a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -22,9 +22,9 @@ Activate Expired Subscription # Update subscription to expire in 5 seconds ${now}= Get Current Date time_zone=UTC ${in_5_seconds}= Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ - ${update_template_fragment}= Load Json From File + ${update_template_fragment}= Load JSON From File ... ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json - ${update_fragment}= Update Value To Json ${update_template_fragment} $..expiresAt ${in_5_seconds} + ${update_fragment}= Update Value To JSON ${update_template_fragment} $..expiresAt ${in_5_seconds} Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} Sleep 10s Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 5bfbde25..69c9629e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -16,8 +16,8 @@ Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 8e9d5457..d996cff6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -16,8 +16,8 @@ Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 7176be42..11abfe09 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that when creating a context source registration without specifying an ID +Documentation Check that you can create a context source registration without specifying an ID Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -13,13 +13,13 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** Create Context Source Registration Without A Sprecified ID - [Documentation] Check that when creating a context source registration without specifying an ID + [Documentation] Check that you can create a context source registration without specifying an ID [Tags] csr-create - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${request} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 49819d92..92f24839 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -30,8 +30,8 @@ Create Context Source With Invalid Content [Tags] csr-create [Arguments] ${filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 400 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 937d6175..8f0667b5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -16,8 +16,8 @@ Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index b5e97371..bc2c7303 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -16,8 +16,8 @@ Create one context source registration using a provided Link header with JSON co [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index d88f3aa5..bf8c0eaa 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -16,8 +16,8 @@ Create one context source registration using the default context with JSON conte [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index 5c57a635..78a6639b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -16,8 +16,8 @@ Create one context source registration containing a JSON-LD @context with a JSON [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index 8342b16a..dcbb5536 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -16,8 +16,8 @@ Create one context source registration using a JSON-LD @context obtained from th [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index d5a8a0af..6a305cd1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -16,8 +16,8 @@ Create one context source registration not containing a JSON-LD @context with a [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index e33532a4..90b94a8e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -16,8 +16,8 @@ Create one context source registration with a Link header and a JSON-LD content [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 25b32bf5..b16395d0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -16,8 +16,8 @@ Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id [Tags] csr-delete ${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} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 657a7240..c6a0411b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -26,8 +26,8 @@ Delete Context Source [Tags] csr-delete [Arguments] ${invalid_registration_id} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index f49a9bce..0f0bb149 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Cases *** Query Context Source Registrations Without Entity Types and Attribute Names - [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} Check Response Status Code Set To 400 diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index c4773448..0820e838 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo +Documentation Check that you can query context source registrations matching property and relationship names of RegistrationInfo Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -26,7 +26,7 @@ Query Without Properties And Relationships *** Keywords *** Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo - [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo + [Documentation] Check that you can query context source registrations matching property and relationship names of RegistrationInfo [Arguments] ${attrs_value} ${expectation_file_path} Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 57ff2406..9a11fd2c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery +Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -25,7 +25,7 @@ Within Polygon [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Geoquery - [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery + [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} Query Context Source Registrations ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 305f52a2..3794117d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI +Documentation Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -17,7 +17,7 @@ Invalid Id [Tags] csr-retrieve 5_10_1 *** Keywords *** Retrieve Context Source Registration With A Not Present Or Invalid Id - [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI + [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI [Arguments] ${id} Retrieve Context Source Registration ${id} Check Response Status Code Set To 400 diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 867c92fc..365c29d1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -18,10 +18,10 @@ ${expectation_file_path_expanded}= csourceRegistrations/exp *** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext +EmptyJSONLdContext [Tags] csr-retrieve 6_3_5 ${EMPTY} ${expectation_file_path_expanded} -CreationTimeJsonLdContext +CreationTimeJSONLdContext [Tags] csr-retrieve 6_3_5 ${ngsild_test_suite_context} ${expectation_file_path_compacted} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 99a5e74d..c0db5c40 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -25,12 +25,12 @@ Update Context Source [Tags] csr-update [Arguments] ${filename} ${update_filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} - ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} + ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${registration_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index d27708cf..bd157e83 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -38,12 +38,12 @@ Update Context Source [Documentation] Check that you cannot update a context source registration under some conditions [Tags] csr-update [Arguments] ${registration_id} ${fragment_filename} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${valid_registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} + ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} @@ -56,8 +56,8 @@ Update a context source registration if the request body is invalid [Documentation] Check that you cannot update a context source registration if the request body is invalid [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Update Context Source Registration Using Session diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 99989cdc..f9f7a674 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -16,8 +16,8 @@ Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 672dd68e..1c62b9ba 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired +Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to "expired" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -16,12 +16,12 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expire *** Test Cases *** Create Context Source Registration Subscription With expiresAt Member - [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired + [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to "expired" [Tags] csrsub-create 5_11_2 ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} - ${subscription_payload}= Update Value To Json ${subscription_payload_sample} $..expiresAt ${expiresAt} + ${subscription_payload}= Update Value To JSON ${subscription_payload_sample} $..expiresAt ${expiresAt} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index b8bc7944..e806af3e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration +Documentation Check that if the created context source registration subscription does not define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -20,7 +20,7 @@ ${update_fragment_file_path}= csourceRegistrations/fra *** Test Cases *** Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration - [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + [Documentation] Check that if the created context source registration subscription does not define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index 368a46cf..dbf64473 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired +Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -29,7 +29,7 @@ ExpiredSubscription *** Keywords *** Do Not Receive cSourceNotification If Subscription Status Is Not Active - [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired + [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index 2a260f89..8cbac3c7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities +Documentation Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -20,7 +20,7 @@ ${update_fragment_file_path}= csourceRegistrations/fra *** Test Cases *** Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information - [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities + [Documentation] Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index bfe09c26..fd6c74f1 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes +Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" and "attributes" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -19,7 +19,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/sub *** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes - [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes + [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" and "attributes" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 3bc78bb0..cc767440 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 +Documentation Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -25,7 +25,7 @@ InvalidNotification *** Keywords *** Update Context Source Registration Subscription With Invalid Fragment - [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 + [Documentation] Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/requirements.txt b/requirements.txt index 05c7c182..b20e1673 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +# python3.10 project robotframework==6.0.2 RESTinstance==1.3.0 robotframework-jsonschemalibrary==1.0 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fc657dc8..ef33eadb 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -197,8 +197,8 @@ Retrieve Entity by Id Create Entity Selecting Content Type [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=${content_type} IF '${accept}'!='${EMPTY}' Set To Dictionary ${headers} Accept=${accept} @@ -216,7 +216,7 @@ Create Entity Selecting Content Type Append Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= REST.POST ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... body=${fragment_payload} @@ -228,7 +228,7 @@ Append Entity Attributes Append Entity Attributes With Parameters [Arguments] ${id} ${fragment_filename} ${content_type} ${options} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= REST.POST ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} ... body=${fragment_payload} @@ -268,7 +268,7 @@ Update Entity Attributes Using Session Update Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= REST.PATCH ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... body=${fragment_payload} @@ -317,7 +317,7 @@ Partial Update Entity Attributes ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= REST.PATCH ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} ... body=${fragment_payload} @@ -468,8 +468,8 @@ Delete Context Source Registration With Return Create Entity [Arguments] ${filename} ${entity_id} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request @@ -477,8 +477,8 @@ Create Entity Create Or Update Temporal Representation Of Entity Selecting Content Type [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json + ${temporal_entity_representation_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To JSON ... ${temporal_entity_representation_payload} ... $..id ... ${temporal_entity_representation_id} @@ -512,7 +512,7 @@ Create Temporal Representation Of Entity Selecting Content Type Using Session Append Attribute To Temporal Entity [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} ${response}= REST.POST ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs ... body=${fragment_payload} @@ -550,7 +550,7 @@ Modify Attribute Instance From Temporal Entity ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} ${response}= REST.PATCH ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... body=${fragment_payload} @@ -651,7 +651,7 @@ Update Temporal Representation Of Entity Selecting Content Type ... ${instanceId} ... ${fragment_filename} ... ${content_type} - ${temporal_entity_fragment}= Load Json From File + ${temporal_entity_fragment}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= REST.PATCH @@ -745,8 +745,8 @@ Batch Request Entities From File Create Temporal Representation Of Entity [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json + ${temporal_entity_representation_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To JSON ... ${temporal_entity_representation_payload} ... $..id ... ${temporal_entity_representation_id} @@ -874,7 +874,7 @@ Query Temporal Representation Of Entities Via Post Set To Dictionary ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} + ${query_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${query_file_name} ${response}= REST.POST ... ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query ... body=${query_payload} @@ -1104,8 +1104,8 @@ Create Subscription ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${filename_path} + ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} Output request Output response @@ -1159,7 +1159,7 @@ Update Subscription ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} + ${subscription_update_fragment}= Load JSON From File ${EXECDIR}/data/${fragment_filename} ${response}= REST.PATCH ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} ... body=${subscription_update_fragment} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index b568c6fa..13fe117f 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -37,7 +37,7 @@ Check Response Body Containing Array Of URIs set to Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} Output ${response_body} Output ${entity_payload} @@ -117,8 +117,8 @@ Check Response Body Containing Batch Operation Result Check Response Body Containing Entity element [Arguments] ${expectation_filename} ${entity_id} ${response_body} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity} ... ${response_body} @@ -128,16 +128,16 @@ Check Response Body Containing Entity element Check Response Body Containing List Containing Entity Elements [Arguments] ${expectation_filename} ${entities_ids} ${response_body} FOR ${entity_id} IN @{entities_ids} - ${entity}= Get Value From Json ${response_body} $[?(@.id=='${entity_id}')] + ${entity}= Get Value From JSON ${response_body} $[?(@.id=='${entity_id}')] Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${entity}[0] END Check Response Body Containing List Containing Entity Elements With Different Types [Arguments] ${filename} ${entities_representation_ids} ${response_body} - ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} + ${entities_representation_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${filename} ${index}= Set Variable 0 FOR ${entity_representation_id} IN @{entities_representation_ids} - ${entities_representation_payload}= Update Value To Json + ${entities_representation_payload}= Update Value To JSON ... ${entities_representation_payload} ... $.[${index}]..id ... ${entity_representation_id} @@ -152,9 +152,9 @@ Check Response Body Containing List Containing Entity Elements With Different Ty Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load Json From File + ${temporal_entity_representation_payload}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/expectations/${filename} - ${temporal_entity_representation}= Update Value To Json + ${temporal_entity_representation}= Update Value To JSON ... ${temporal_entity_representation_payload} ... $..id ... ${temporal_entity_representation_id} @@ -166,11 +166,11 @@ Check Response Body Containing EntityTemporal element Check Response Body Containing List Containing EntityTemporal elements [Arguments] ${filename} ${temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Load Json From File + ${temporal_entities_representation_payload}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${index}= Set Variable 0 FOR ${temporal_entity_representation_id} IN @{temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Update Value To Json + ${temporal_entities_representation_payload}= Update Value To JSON ... ${temporal_entities_representation_payload} ... $.[${index}]..id ... ${temporal_entity_representation_id} @@ -185,8 +185,8 @@ Check Response Body Containing List Containing EntityTemporal elements Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription} @@ -196,10 +196,10 @@ Check Response Body Containing Subscription element Check Response Body Containing List Containing Subscription elements [Arguments] ${expectation_file_path} ${subscription_ids} - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${subscription_id} IN @{subscription_ids} - ${subscription_payload}= Update Value To Json + ${subscription_payload}= Update Value To JSON ... ${subscription_payload} ... $.[${index}]..id ... ${subscription_id} @@ -235,8 +235,8 @@ Check Response Body Containing Number Of Entities Check Response Body Containing Context Source Registration element [Arguments] ${expectation_filename} ${context_source_registration_id} - ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${context_source_registration}= Update Value To Json + ${context_source_registration_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${context_source_registration}= Update Value To JSON ... ${context_source_registration_payload} ... $..id ... ${context_source_registration_id} @@ -249,7 +249,7 @@ Check Response Body Containing Context Source Registration element Check Response Body Containing EntityTypeList element [Arguments] ${expectation_filename} - ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${entity_type_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_list_payload} @@ -259,7 +259,7 @@ Check Response Body Containing EntityTypeList element Check Response Body Containing EntityType element [Arguments] ${expectation_filename} - ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${entity_type_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_payload} @@ -269,7 +269,7 @@ Check Response Body Containing EntityType element Check Response Body Containing EntityTypeInfo element [Arguments] ${expectation_filename} - ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${entity_type_info_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_info_payload} @@ -279,7 +279,7 @@ Check Response Body Containing EntityTypeInfo element Check Response Body Containing AttributeList element [Arguments] ${expectation_filename} - ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${attribute_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_list_payload} @@ -289,7 +289,7 @@ Check Response Body Containing AttributeList element Check Response Body Containing Attribute element [Arguments] ${expectation_filename} - ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${attribute_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_payload} @@ -299,11 +299,11 @@ Check Response Body Containing Attribute element Check Response Body Containing List Containing Context Source Registrations elements [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Load Json From File + ${expected_context_source_registrations_payload}= Load JSON From File ... ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${expected_context_source_registration_id} IN @{expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Update Value To Json + ${expected_context_source_registrations_payload}= Update Value To JSON ... ${expected_context_source_registrations_payload} ... $.[${index}]..id ... ${expected_context_source_registration_id} @@ -360,7 +360,7 @@ Check JSON Value In Response Body Check NotificationParams [Arguments] ${filename} ${expected_additional_members} - ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} + ${expected_notification}= Load JSON From File ${EXECDIR}/data/${filename} ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_notification} @@ -390,8 +390,8 @@ Check Pagination Prev And Next Headers Check Response Body Containing One Subscription element [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} - ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} + ${subscription}= Update Value To JSON ${payload} $..id ${response_body['id']} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription} ... ${response_body} @@ -400,8 +400,8 @@ Check Response Body Containing One Subscription element Check Response Body Containing One Registration element [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} + ${registration}= Update Value To JSON ${payload} $..id ${response_body['id']} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${registration} ... ${response_body} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 43a3a0ec..52cd6969 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -15,18 +15,18 @@ ${context_source_url}= http://${context_source_host}:${context_source_p Load Entity [Arguments] ${entity_file_name} ${entity_id} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${entity_file_name} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${entity_file_name} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} RETURN ${entity} Load Test Sample [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} - ${test_sample_payload}= Load Json From File ${EXECDIR}/data/${test_sample_file_path} - ${test_sample}= Update Value To Json ${test_sample_payload} $..id ${test_sample_id} + ${test_sample_payload}= Load JSON From File ${EXECDIR}/data/${test_sample_file_path} + ${test_sample}= Update Value To JSON ${test_sample_payload} $..id ${test_sample_id} IF '${test_sample_id}'=='' - Delete Object From Json ${test_sample} $..id + Delete Object From JSON ${test_sample} $..id END RETURN ${test_sample} @@ -37,7 +37,7 @@ Load Subscription Sample With Reachable Endpoint ... ${notification_endpoint_uri}=${notification_server_url} ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} - ${subscription}= Update Value To Json + ${subscription}= Update Value To JSON ... ${subscription_payload} ... $..notification['endpoint']['uri'] ... ${notification_endpoint_uri} @@ -46,7 +46,7 @@ Load Subscription Sample With Reachable Endpoint Set Entity Id In Subscription [Arguments] ${subscription_payload} ${entity_id} ${dict}= Create Dictionary id=${entity_id} - ${subscription}= Add Object To Json ${subscription_payload} $..entities[0] ${dict} + ${subscription}= Add Object To JSON ${subscription_payload} $..entities[0] ${dict} RETURN ${subscription} Load Context Source Registration Sample With Reachable Context Source @@ -58,7 +58,7 @@ Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_file_path} ... ${context_source_registration_id} - ${context_source_registration}= Update Value To Json + ${context_source_registration}= Update Value To JSON ... ${context_source_registration_payload} ... $..endpoint ... ${context_source_endpoint_uri} @@ -67,7 +67,7 @@ Load Context Source Registration Sample With Reachable Context Source Remove Entity Type [Arguments] ${entity} - ${invalid_entity}= Delete Object From Json ${entity} $..type + ${invalid_entity}= Delete Object From JSON ${entity} $..type RETURN ${invalid_entity} Generate Random Entity Id @@ -86,5 +86,5 @@ Create Batch Operation Result Upsert Element In Entity [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ - ${updated_entity}= Add Object To Json ${initial_entity} ${jsonPath} ${fragment} + ${updated_entity}= Add Object To JSON ${initial_entity} ${jsonPath} ${fragment} RETURN ${updated_entity} -- GitLab From 1c0b639278b2e220902b0dc5ff00e68ac4bb23c8 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Wed, 31 May 2023 09:36:38 +0200 Subject: [PATCH 5/6] chore: mainly renaming JSON to Json in TC --- TP/NGSI-LD/CommonBehaviours/043.robot | 12 ++++++------ .../RetrieveAvailableAttributes/025_01.robot | 4 ++-- .../RetrieveAvailableEntityTypes/022_01.robot | 4 ++-- .../026_01.robot | 4 ++-- .../023_01.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/018_06.robot | 4 ++-- .../BatchEntities/CreateBatchOfEntities/003_03.robot | 4 ++-- .../BatchEntities/DeleteBatchOfEntities/006_03.robot | 4 ++-- .../BatchEntities/UpdateBatchOfEntities/005_04.robot | 4 ++-- .../BatchEntities/UpsertBatchOfEntities/004_06.robot | 4 ++-- .../Provision/Entities/CreateEntity/001_02.robot | 4 ++-- .../DeleteAttributeInstance/017_02.robot | 4 ++-- .../DeleteAttributeInstance/017_03.robot | 2 +- .../Subscription/CreateSubscription/028_02.robot | 4 ++-- .../QueryContextSourceRegistrations/037_02.robot | 4 ++-- .../RetrieveContextSourceRegistration/036_05.robot | 4 ++-- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 4d200916..3643488a 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved +Documentation Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -20,7 +20,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration *** Test Cases *** 043_01 Create entity - [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type @@ -35,7 +35,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription - [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription) [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -47,7 +47,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities - [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) [Tags] te-create 5_2_2 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type @@ -62,7 +62,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create - [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create) [Tags] be-create 5_2_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -78,7 +78,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration - [Documentation] Verify throwing 503 – LDContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) [Tags] csr-create 5_2_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} 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 86a5d856..17bb74b3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -16,10 +16,10 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJSONLdContext +WithoutJsonLdContext [Tags] ed-attrs 5_7_8 ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json -WithJSONLdContext [Tags] ed-attrs 5_7_8 +WithJsonLdContext [Tags] ed-attrs 5_7_8 ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json 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 fbf5f397..22b2d42a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -18,10 +18,10 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJSONLdContext +WithoutJsonLdContext [Tags] ed-types 5_7_5 ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json -WithJSONLdContext [Tags] ed-types 5_7_5 +WithJsonLdContext [Tags] ed-types 5_7_5 ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json 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 8c63e9f5..77ac8a2d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -16,10 +16,10 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJSONLdContext +WithoutJsonLdContext [Tags] ed-attrs-details 5_7_9 ${EMPTY} types/expectations/attribute-026-01-01-expectation.json -WithJSONLdContext [Tags] ed-attrs-details 5_7_9 +WithJsonLdContext [Tags] ed-attrs-details 5_7_9 ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json 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 b4d40c15..3f76ca0e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -18,10 +18,10 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJSONLdContext +WithoutJsonLdContext [Tags] ed-types-details 5_7_6 ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json -WithJSONLdContext [Tags] ed-types-details 5_7_6 +WithJsonLdContext [Tags] ed-types-details 5_7_6 ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json 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 012e4ed6..40246d08 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -18,10 +18,10 @@ ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-co *** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJSONLdContext +EmptyJsonLdContext [Tags] e-retrieve 6_3_5 ${EMPTY} ${empty_jsonld_expectation_filename} -CreationTimeJSONLdContext +CreationTimeJsonLdContext [Tags] e-retrieve 6_3_5 ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index 76f41c66..afbc5db4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -8,9 +8,9 @@ Test Template Create Batch Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJSON [Tags] be-create 5_6_7 +InvalidJson [Tags] be-create 5_6_7 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -EmptyJSON [Tags] be-create 5_6_7 +EmptyJson [Tags] be-create 5_6_7 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index f4bb7917..c36cc59e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -8,9 +8,9 @@ Test Template Batch Delete Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJSON [Tags] be-delete 5_6_10 +InvalidJson [Tags] be-delete 5_6_10 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -EmptyJSON [Tags] be-delete 5_6_10 +EmptyJson [Tags] be-delete 5_6_10 batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index 77c7535c..e00b0a4e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -8,9 +8,9 @@ Test Template Batch Update Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJSON [Tags] be-update 5_6_9 +InvalidJson [Tags] be-update 5_6_9 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -InvalidJSONLd [Tags] be-update 5_6_9 +InvalidJsonLd [Tags] be-update 5_6_9 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 3f4771aa..1b8c9cc3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -8,9 +8,9 @@ Test Template Batch Upsert Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJSON [Tags] be-upsert 5_6_8 +InvalidJson [Tags] be-upsert 5_6_8 batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -InvalidJSONLd [Tags] be-upsert 5_6_8 +InvalidJsonLd [Tags] be-upsert 5_6_8 batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 8cea8652..061bdd72 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -8,9 +8,9 @@ Test Template Create Entity With Invalid Request Scenarios *** Test Cases *** FILENAME ERROR_TYPE -001_02_01_InvalidJSON +001_02_01_InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -001_02_02_EmptyJSON +001_02_02_EmptyJson empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 4c69535b..79f7aea0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -31,7 +31,7 @@ ${status_code}= 400 *** Keywords *** Delete attribute instance - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right [Tags] tea-instance-delete 5_6_15 [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${response}= Delete Attribute Instance From Temporal Entity 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 4e663df8..59d1a523 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/attributeId/InstanceId is not right +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index 735bf757..6fdab2c6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -8,9 +8,9 @@ Test Template Create Subscription With Invalid Request *** Test Cases *** FILENAME EXPECTED_STATUS -028_02_01_InvalidJSON +028_02_01_InvalidJson subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -028_02_02_EmptyJSON +028_02_02_EmptyJson subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 0f0bb149..8d9ca6d1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type Bad Request (400) is returned. Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Cases *** Query Context Source Registrations Without Entity Types and Attribute Names - [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type Bad Request (400) is returned. [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} Check Response Status Code Set To 400 diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 365c29d1..867c92fc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -18,10 +18,10 @@ ${expectation_file_path_expanded}= csourceRegistrations/exp *** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJSONLdContext +EmptyJsonLdContext [Tags] csr-retrieve 6_3_5 ${EMPTY} ${expectation_file_path_expanded} -CreationTimeJSONLdContext +CreationTimeJsonLdContext [Tags] csr-retrieve 6_3_5 ${ngsild_test_suite_context} ${expectation_file_path_compacted} -- GitLab From c3a5837d1ac715a8b9a10e49bc55a58772e8b370 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Wed, 31 May 2023 15:59:24 +0200 Subject: [PATCH 6/6] chore: rename the documentation to adapt it to other tcs --- .../Registration/QueryContextSourceRegistrations/037_02.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 8d9ca6d1..86577045 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type Bad Request (400) is returned. +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Cases *** Query Context Source Registrations Without Entity Types and Attribute Names - [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type Bad Request (400) is returned. + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} Check Response Status Code Set To 400 -- GitLab