diff --git a/.idea/runConfigurations/jsonldContext_Consumption_Unit_Tests.xml b/.idea/runConfigurations/jsonldContext_Consumption_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..e4904242a10e903a4ba44fc02f9b522d2f498e76 --- /dev/null +++ b/.idea/runConfigurations/jsonldContext_Consumption_Unit_Tests.xml @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/jsonldContext_Provision_Unit_Tests.xml b/.idea/runConfigurations/jsonldContext_Provision_Unit_Tests.xml new file mode 100644 index 0000000000000000000000000000000000000000..febd49d54c1709651f30e58bf5ce272fd44b6a06 --- /dev/null +++ b/.idea/runConfigurations/jsonldContext_Provision_Unit_Tests.xml @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/README.md b/README.md index c7d52cccfc782d72cc6a471119eebfc623b2a2ce..e14b5ae8ff7e65b81f35ea471e26a15481fefcdf 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,9 @@ server to listen to notifications (the address must be accessible by the context Default value: `0.0.0.0` and `8085`. - `context_source_host` and `context_source_port` : The address and port used for the context source. Default value: `0.0.0.0` and `8086`. +- `context_server_host` and `context_server_port` : The address and port used for the context server provider. +Default value: `0.0.0.0` and `8087`. +- `core_context`: The default cached core context used by the Brokers. When you execute locally the tests, you can leave the default values as they are. NGSI-LD Test Suite provides a mockup services to provide the notification functionality and therefore the notification_server_host can be 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 20aaf6e6eb5914008e30a3bad3a4ebca36a144f2..61877562e4ddd81739bc87ceb91af52aa356e669 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 @@ -49,9 +49,9 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity Elements - ... ${expectation_filename} - ... ${entities_ids_to_be_compared} - ... ${response.json()} + ... expectation_filename=${expectation_filename} + ... entities_ids=${entities_ids_to_be_compared} + ... response_body=${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot index 73484e24301bec660e34cb129e241048c3d8838c..91261d2c65f21c6ff1059749b9cc616bae3bc6d7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot @@ -21,15 +21,16 @@ ${airQualityLevel}= airQualityLevel==6 *** Test Cases *** Q_PARAMETER EXPECTED_STATUS EXPECTED_COUNT 019_07_01 Check that the total number of matching results is returned if the count parameter is set to true and only the entity type is provided + [Tags] e-query 5_7_2 6_3_13 ${EMPTY} 200 2 019_07_02 Check that the total number of matching results is returned if the count parameter is set to true and a q parameter is provided + [Tags] e-query 5_7_2 6_3_13 ${airQualityLevel} 200 1 *** Keywords *** Query Entities With Count [Documentation] If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results. - [Tags] e-query 5_7_2 6_3_13 [Arguments] ${q} ${expected_status_code} ${expected_count} ${response}= Query Entities ... entity_types=${entity_type} 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 4cab8706ae3fcab67fbf439eac212c52bbba433d..92f682aabed0db9f7b8bcca35f3066a11f2fc967 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -36,7 +36,9 @@ Append Attributes Without Params ... id=${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} + Check Updated Resource Set To + ... updated_resource=${entity_expectation_payload} + ... response_body=${response1.json()} Create Initial Entity ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot index 80ebd7095096add71c13add952811a82b8aa9aa4..813293927ab6df6572ae9e9db6edd8e95c2ece5e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot @@ -16,38 +16,35 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-speed-two-datasetid-sample.jsonld -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_BODY EXPECTATION_FILENAME +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME 010_04_01 Append entity attributes and ignore existing multi-attribute instance - 204 vehicle-attribute-to-add-fragment.jsonld ${EMPTY} vehicle-speed-appended-expectation.jsonld + 204 vehicle-attribute-to-add-fragment.jsonld vehicle-speed-appended-expectation.jsonld 010_04_02 Append entity attributes with a new multi-attribute instance - 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld + 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld *** Keywords *** Append Attributes With Params [Documentation] Check that you can append entity attributes [Tags] ea-append 5_6_3 - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${response}= Append Entity Attributes With Parameters ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} ... noOverwrite Check Response Status Code ${status_code} ${response.status_code} - # ignore the reason for the not updated attribute as this detail is up to each context broker implementation - IF "${expectation_response_body}"!="${EMPTY}" - Check Response Body Content - ... expectation_filename=${expectation_response_body} - ... response_body=${response.json()} - ... additional_ignored_path=root\\['notUpdated'\\]\\[0\\]\\['reason'\\] - END + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} ${response1}= Retrieve Entity by Id ... id=${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + Check Updated Resource Set To + ... updated_resource=${entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} Create Initial Entity ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} 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 65211d518a2ccfbcc225ad77bc569a1c5acc8135..ee6c473e9e5f644898ae2c6796a138600e7a2aad 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -51,7 +51,10 @@ Delete Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response2.json()} ${ignored_attributes} + Check Updated Resource Set To + ... updated_resource=${entity_expectation_payload} + ... response_body=${response2.json()} + ... ignored_keys=${ignored_attributes} Delete Initial Entities Delete Entity by Id ${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 5ac36e31817523095b444826c093ba6edd01067d..8f45de32f9ccddddf0451544372130edcb95db24 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -41,7 +41,10 @@ Update Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + Check Updated Resource Set To + ... updated_resource=${entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} Initiate Test Case ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} 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 8fbac35714e18d3f67f13a2fa892c875d8bfb0c8..02f52ce5b7c3f1076e0c35650cebb2ffa23a4619 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -50,7 +50,10 @@ Update Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + Check Updated Resource Set To + ... updated_resource=${entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} Delete Initial Entities Delete Entity by Id ${entity_id} 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 ae5cf6be47766bbce200d431e2e61f078dae1802..ce010f3333aff299b8fc796a9e018c114e915619 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -41,9 +41,9 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To - ... ${temporal_entity_expectation_payload} - ... ${response2.json()} - ... ${ignored_attributes} + ... updated_resource=${temporal_entity_expectation_payload} + ... response_body=${response2.json()} + ... ignored_keys=${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot index 1fdb1f2c1c3aca798ef6346a94c76cbe52e9a99f..e4c99ed41b58f8aea8853c1464aa4c65b1a21b71 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AddAttributes/014_01.robot @@ -41,9 +41,9 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To - ... ${temporal_entity_expectation_payload} - ... ${response1.json()} - ... ${ignored_attributes} + ... updated_resource=${temporal_entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} *** Keywords *** 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 f854ab85953db99428ca837cca489eda548b38b4..21369d4560893da3608635f88c6184cfae9c0adc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -49,9 +49,9 @@ Delete Attribute From A Temporal Entity ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To - ... ${temporal_entity_expectation_payload} - ... ${response1.json()} - ... ${ignored_attributes} + ... updated_resource=${temporal_entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} Initialize Setup ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} 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 072e7cb8e85292d977ac462804d4236210efd3ea..bd579a64a4498229b9b99444a3f2644ffe881b11 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -48,9 +48,9 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To - ... ${temporal_entity_expectation_payload} - ... ${response1.json()} - ... ${ignored_attributes} + ... updated_resource=${temporal_entity_expectation_payload} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 0ea7eef0b329c5199450a2cf50fd8d9079232790..5a3834a274e5fe141751273420d59463d868fdf8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -32,7 +32,10 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} ${ignored_attributes}= Create List ${status_regex_expr} - Check Updated Resource Set To ${subscription} ${response1.json()} ${ignored_attributes} + Check Updated Resource Set To + ... updated_resource=${subscription} + ... response_body=${response1.json()} + ... ignored_keys=${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 967fa553846eda9b51958044ddf3b848bb53a81b..9c47f2cbe36a2a28267fb7a49513b0885b0bc290 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -37,12 +37,16 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Check Created Resource Set To ${subscription_payload} ${response1.json()} ${ignored_attributes} - Check Dictionary Might Contain Additional Members of the NotificationParams + Check Response Body Might Contain Additional Members of the NotificationParams ... ${response1.json()} ... lastNotification - Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastFailure - Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastSuccess - Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} timesSent + Check Response Body Might Contain Additional Members of the NotificationParams + ... ${response1.json()} + ... lastFailure + Check Response Body Might Contain Additional Members of the NotificationParams + ... ${response1.json()} + ... lastSuccess + Check Response Body Might Contain Additional Members of the NotificationParams ${response1.json()} timesSent *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 8c927794d3d6a46e96e3875f20cacbcb1c886b39..b146cebd9933f40b2cf208908f0474e047735796 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -51,12 +51,12 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr ... response_body=${response.json()} ... ignored_keys=${ignored_attributes} - Check Dictionary Might Contain Additional Members of the NotificationParams + Check Response Body Might Contain Additional Members of the NotificationParams ... ${response.json()} ... lastNotification - Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastFailure - Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastSuccess - Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} timesSent + Check Response Body Might Contain Additional Members of the NotificationParams ${response.json()} lastFailure + Check Response Body Might Contain Additional Members of the NotificationParams ${response.json()} lastSuccess + Check Response Body Might Contain Additional Members of the NotificationParams ${response.json()} timesSent *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 7269685b66d7d85f9ddbec7db51e1a5ae07fd457..d7dfeb9cf87fafb4ee7379020985430b13483092 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -32,7 +32,9 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s ... subscription_id=${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${subscription} ${response1.json()} + Check Updated Resource Set To + ... updated_resource=${subscription} + ... response_body=${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..5543d6c8e8b5ae29407c19bb6230090164e76ffc --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that you can list all the @context available in the broker with no previous add @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template List @contexts with no previous created @context + + +*** Variables *** +${filename}= @context-minimal-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND COUNT +052_01_01 List @contexts with neither details or kind and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ${EMPTY} 1 +052_01_02 List @contexts with no details and kind equal to hosted and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Hosted 0 +052_01_03 List @contexts with no details and kind equal to cached and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Cached 1 +052_01_04 List @contexts with no details and kind equal to implicitlycreated and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ImplicitlyCreated 0 +052_01_05 List @contexts with details equal to false and no kind and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ${EMPTY} 1 +052_01_06 List @contexts with details equal to false and kind equal to hosted and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Hosted 0 +052_01_07 List @contexts with details equal to false and kind equal to cached and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Cached 1 +052_01_08 List @contexts with details equal to false and kind equal to implicitlycreated and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ImplicitlyCreated 0 + + +*** Keywords *** +List @contexts with no previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} ${count} + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Context Response Body Containing a list of identifiers + ... response_body=${response.json()} + ... expected_length=${count} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..a638aa56de8bc6da99ad5ea136a470debd1d0abd --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot @@ -0,0 +1,70 @@ +*** Settings *** +Documentation Check that you can list all the @context available in the broker with one add @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context +Test Teardown Delete Initial @context +Test Template List @contexts with one previous created @context + + +*** Variables *** +${first_filename}= @context-minimal-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND COUNT +052_02_01 List @contexts with neither details or kind and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ${EMPTY} 2 +052_02_02 List @contexts with no details and kind equal to hosted and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Hosted 1 +052_02_03 List @contexts with no details and kind equal to cached and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Cached 1 +052_02_04 List @contexts with no details and kind equal to implicitlycreated and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ImplicitlyCreated 0 +052_02_05 List @contexts with details equal to false and no kind and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ${EMPTY} 2 +052_02_06 List @contexts with details equal to false and kind equal to hosted and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Hosted 1 +052_02_07 List @contexts with details equal to false and kind equal to cached abd with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Cached 1 +052_02_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously one add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ImplicitlyCreated 0 + + +*** Keywords *** +Create Initial @context + ${response}= Add a new @context ${first_filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + @{uri_list}= Create List + Append To List ${uri_list} ${uri} + Set Suite Variable ${uri_list} + +List @contexts with one previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} ${count} + + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Context Response Body Containing a list of identifiers + ... response_body=${response.json()} + ... expected_length=${count} + ... list_contexts=${uri_list} + ... kind=${kind} + +Delete Initial @context + Delete a @context ${uri_list[0]} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..fa5fecdf368b6d84e34a4d8090c4479f58abcb68 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot @@ -0,0 +1,89 @@ +*** Settings *** +Documentation Check that you can list all the @context available in the broker with several add @contexts + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial set of @contexts +Test Teardown Delete Initial @contexts +Test Template List @contexts with several previous created @context + + +*** Variables *** +${first_filename}= @context-minimal-valid.json +${second_filename}= @context-minimal-second-valid.json +${third_filename}= @context-minimal-third-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND COUNT +052_03_01 List @contexts with neither details or kind and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ${EMPTY} 4 +052_03_02 List @contexts with no details and kind equal to hosted and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Hosted 3 +052_03_03 List @contexts with no details and kind equal to cached and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Cached 1 +052_03_04 List @contexts with no details and kind equal to implicitlycreated and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ImplicitlyCreated 0 +052_03_05 List @contexts with details equal to false and no kind and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ${EMPTY} 4 +052_03_06 List @contexts with details equal to false and kind equal to hosted and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Hosted 3 +052_03_07 List @contexts with details equal to false and kind equal to cached abd with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Cached 1 +052_03_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously several add @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ImplicitlyCreated 0 + + +*** Keywords *** +Create Initial set of @contexts + ${response}= Add a new @context ${first_filename} + Check Response Status Code 201 ${response.status_code} + ${first_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${first_uri} + + ${response}= Add a new @context ${second_filename} + Check Response Status Code 201 ${response.status_code} + ${second_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${second_uri} + + ${response}= Add a new @context ${third_filename} + Check Response Status Code 201 ${response.status_code} + ${third_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${third_uri} + + @{uri_list}= Create List + Append To List ${uri_list} ${first_uri} + Append To List ${uri_list} ${second_uri} + Append To List ${uri_list} ${third_uri} + Set Suite Variable ${uri_list} + +List @contexts with several previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} ${count} + + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Context Response Body Containing a list of identifiers + ... response_body=${response.json()} + ... expected_length=${count} + ... list_contexts=${uri_list} + ... kind=${kind} + +Delete Initial @contexts + FOR ${uri} IN @{uri_list} + Log URI: ${uri} + Delete a @context ${uri} + END diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_04.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..ece295e6a957104a0f84b751aff17c273584ecd2 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_04.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you get an error when try to list @context with wrong details or kind + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template List @contexts with no previous created @context + + +*** Variables *** +${filename}= @context-minimal-valid.json +${reason_400}= Bad Request +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND +052_04_01 List @contexts with no details and kind set to other and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} other +052_04_02 List @contexts with details set to other and no kind and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + other ${EMPTY} +052_04_03 List @contexts with details set to other and kind set to other and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + other other +052_04_04 List @contexts with details set to true and kind set to other and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + true other +052_04_05 List @contexts with details set to other and kind set to Hosted and not previously created @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + other Hosted + + +*** Keywords *** +List @contexts with no previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 400 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_400} + Check Response Body Containing ProblemDetails Element ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..282a6377c89b309b12672c0e564743002328a6c3 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot @@ -0,0 +1,78 @@ +*** Settings *** +Documentation Check that you can list all the @context available in the broker with several add @contexts with details equal to true + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial set of @contexts +Test Teardown Delete Initial @contexts +Test Template List @contexts with several previous created @context + + +*** Variables *** +${first_filename}= @context-minimal-valid.json +${second_filename}= @context-minimal-second-valid.json +${third_filename}= @context-minimal-third-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND COUNT +052_05_01 List @contexts with details set to true and no kind and with previously several add @contexts + [Tags] ctx-list 5_13_3 since_v1.5.1 + true ${EMPTY} 4 +052_05_02 List @contexts with details set to true and kind set to hosted and with previously several add @contexts + [Tags] ctx-list 5_13_3 since_v1.5.1 + true Hosted 3 +052_05_03 List @contexts with details set to true and kind set to cached abd with previously several add @contexts + [Tags] ctx-list 5_13_3 since_v1.5.1 + true Cached 1 +052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts + [Tags] ctx-list 5_13_3 since_v1.5.1 + true ImplicitlyCreated 0 + + +*** Keywords *** +Create Initial set of @contexts + ${response}= Add a new @context ${first_filename} + Check Response Status Code 201 ${response.status_code} + ${first_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${first_uri} + + ${response}= Add a new @context ${second_filename} + Check Response Status Code 201 ${response.status_code} + ${second_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${second_uri} + + ${response}= Add a new @context ${third_filename} + Check Response Status Code 201 ${response.status_code} + ${third_uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${third_uri} + + @{uris}= Create List + Append To List ${uris} ${first_uri} + Append To List ${uris} ${second_uri} + Append To List ${uris} ${third_uri} + Set Suite Variable ${uris} + +List @contexts with several previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} ${count} + + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + + # We need to check the list of responses + Check Context Response Body Containing a JSONObject with details of the @contexts + ... response=${response.json()} + ... expected_length=${count} + ... list_contexts=${uris} + +Delete Initial @contexts + FOR ${uri} IN @{uris} + Log URI: ${uri} + Delete a @context ${uri} + END diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot new file mode 100644 index 0000000000000000000000000000000000000000..126332e25eb082aaa406b864f34e0b945f93165d --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot @@ -0,0 +1,93 @@ +*** Settings *** +Documentation Check that you can list all the @context available in the broker with no previous add @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource + +Test Setup Create initial ImplicitlyCreated @context +Test Teardown Delete Initial @context Data +Test Template List @contexts with no previous created @context + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld +${filename}= @context-minimal-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS KIND COUNT +052_06_01 List @contexts with neither details or kind and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ${EMPTY} 4 +052_06_02 List @contexts with no details and kind set to hosted and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Hosted 0 +052_06_03 List @contexts with no details and kind set to cached and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} Cached 3 +052_06_04 List @contexts with no details and kind set to implicitlycreated and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + ${EMPTY} ImplicitlyCreated 1 +052_06_05 List @contexts with details set to false and no kind and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ${EMPTY} 4 +052_06_06 List @contexts with details set to false and kind equal to hosted and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Hosted 0 +052_06_07 List @contexts with details set to false and kind equal to cached and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false Cached 3 +052_06_08 List @contexts with details set to false and kind equal to implicitlycreated and a created ImplicitlyCreated @context + [Tags] ctx-list 5_13_3 since_v1.5.1 + false ImplicitlyCreated 1 + + +*** Keywords *** +List @contexts with no previous created @context + [Documentation] Check that you can list @contexts + [Arguments] ${details} ${kind} ${count} + ${response}= List @contexts ${details} ${kind} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Context Response Body Containing a list of identifiers + ... response_body=${response.json()} + ... expected_length=${count} + ... list_contexts=${list_contexts} + +Create initial ImplicitlyCreated @context + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + Append To List ${list_contexts} ${implicit_id} + + Check Context Response Body Containing numberOfHits value ${data} 1 + + Set Global Variable ${implicit_id} + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_01.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..eab7135683cb575019786d142effc0b387b18ab2 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_01.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that you can serve a previous created @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context +Test Teardown Delete Initial @context +Test Template Serve a @context with details + + +*** Variables *** +${filename}= @context-minimal-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS +053_01_01 Serve a @context without details + [Tags] ctx-serve 5_13_4 since_v1.5.1 + ${EMPTY} +053_01_02 Serve a @context with details equal to false + [Tags] ctx-serve 5_13_4 since_v1.5.1 + false + + +*** Keywords *** +Create Initial @context + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + +Serve a @context with details + [Documentation] Check that you can serve a @context with details equal to empty or false + [Arguments] ${details} + + ${response}= Serve a @context ${uri} ${details} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + Check Context Response Body Content ${filename} ${response.json()} + +Delete Initial @context + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_02.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..ba065950612f53bb64344bea6b6e7042e4dfafff --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_02.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can serve a previous created @context with details equal to True + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context +Test Teardown Delete Initial @context +Test Template Serve a @context with details equal to true + + +*** Variables *** +${filename}= @context-minimal-valid.json +${reason_200}= OK +${reason_204}= No Content + + +*** Test Cases *** DETAILS CONTEXT_TYPE +053_02_01 Serve a @context with details set to True + [Tags] ctx-serve 5_13_4 since_v1.5.1 + true Hosted + + +*** Keywords *** +Create Initial @context + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + +Serve a @context with details equal to true + [Documentation] Check that you can serve a @context with details + [Arguments] ${details} ${context_type} + + ${response}= Serve a @context ${uri} ${details} + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + + # Check mandatory keys in the response (URL, localId, kind, timestamp) and their possible values + Check Context Response Body Containing Detailed Information ${response.json()} ${context_type} + + # Check optional keys in the response (lastUsage, numberOfHits, extraInfo) and their possible values + Check Response Body Might Contain Optional Fields ${response.json()} lastUsage + Check Response Body Might Contain Optional Fields ${response.json()} numberOfHits + Check Response Body Might Contain Optional Fields ${response.json()} extraInfo + + # Check that there is no other keys + Check Context Detailed Information Keys ${response.json()} + +Delete Initial @context + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..74efea15b616b6f4e6926b4061bbd8003f099415 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation Check that you get an error when try to serve a @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context +Test Teardown Delete Initial @context +Test Template Serve @context with no previous created @context + + +*** Variables *** +${filename}= @context-minimal-valid.json +${cached_id}= https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld +${reason_400}= Bad Request +${reason_404}= Not Found +${reason_422}= Unprocessable Content + + +*** Test Cases *** CONTEXTID DETAILS STATUSCODE REASON ERROR +053_03_01 Serve a @contexts with a wrong id and correct details + [Tags] ctx-serve 5_13_4 since_v1.5.1 + wrong_id_context true 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +053_03_02 Serve a @contexts with a valid id and incorrect details + [Tags] ctx-serve 5_13_4 since_v1.5.1 + ${uri} other 400 ${reason_400} ${ERROR_TYPE_BAD_REQUEST_DATA} +053_03_03 Serve a Cached @contexts with details set to false + [Tags] ctx-serve 5_13_4 since_v1.5.1 + ${cached_id} false 422 ${reason_422} ${ERROR_OPERATION_NOT_SUPPORTED} + + +*** Keywords *** +Serve @context with no previous created @context + [Documentation] Check that an error is returned when we request for a @context that does not exist + [Arguments] ${contextid} ${details} ${statuscode} ${reason} ${error} + ${response}= Serve a @context ${contextid} ${details} + + Check Response Status Code ${statuscode} ${response.status_code} + Check Response Reason set to ${response.reason} ${reason} + Check Response Body Containing ProblemDetails Element ${response.json()} ${error} + +Create Initial @context + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + +Delete Initial @context + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_04.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..3265e565a090a6275478a455860ca09d45fcbed5 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_04.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation Check that you can get an increase numberOfHits after creation of a Hosted @context and using it + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context condition from an external server +Test Teardown Delete Initial @context condition from an external server + + +*** Variables *** +${filename}= @context-minimal-valid.json +${entityfile}= minimal-entity-using-@context.jsonld +${entity_context_id}= urn:ngsi-ld:Building:randomUUID + + +*** Test Cases *** +053_04_01 Check that the numberOfHits is increased after using a Hosted context + [Documentation] Check that the numberOfHits is increased after using a Hosted context + [Tags] ctx-serve 5_13_4 since_v1.5.1 + + Create Entity selecting @context ${entityfile} ${uri} + + ${response}= Serve a @context + ... contextId=${uri} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Context Response Body Containing numberOfHits value ${response.json()} 2 + + +*** Keywords *** +Create Initial @context condition from an external server + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + + ${response}= Serve a @context + ... contextId=${uri} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Context Response Body Containing numberOfHits value ${response.json()} 1 + +Delete Initial @context condition from an external server + Delete Entity by Id ${entity_context_id} + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..8db4a2c47f797fc365f136dcf6e0565b24c41d88 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Resource ${EXECDIR}/resources/ContextServerUtils.resource +Library Collections +Library String +Variables ${EXECDIR}/resources/variables.py +Library HttpCtrl.Client +Library HttpCtrl.Server + +Test Setup Create Initial @context condition from an external server +Test Teardown Delete Initial @context condition from an external server + + +*** Variables *** +${filename}= @context-minimal-valid.json +${entityfile}= minimal-entity-using-@context.jsonld +${entity_context_id}= urn:ngsi-ld:Testing:randomUUID +${uri} /api/v1/context.jsonld +${reason_200}= OK + + +*** Test Cases *** +053_05_01 Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true + [Documentation] Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true + [Tags] ctx-serve 5_13_4 since_v1.5.1 + + ${response}= Serve a @context + ... contextId=${uri} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + + # Check mandatory keys in the response (URL, localId, kind, timestamp) and their possible values + Check Context Response Body Containing Detailed Information ${response.json()} Cached + + # Check optional keys in the response (lastUsage, numberOfHits, extraInfo) and their possible values + Check Response Body Might Contain Optional Fields ${response.json()} lastUsage + Check Response Body Might Contain Optional Fields ${response.json()} numberOfHits + Check Response Body Might Contain Optional Fields ${response.json()} extraInfo + + # Check that there is no other keys + Check Context Detailed Information Keys ${response.json()} + + +*** Keywords *** +Create Initial @context condition from an external server + Start @context Local Server + + ${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} + Set Global Variable ${uri} + + Create Entity selecting @context ${entityfile} ${uri} + + Log Waiting 3 seconds to continue... + Sleep 3s + + ${response}= Serve a @context ${uri} true + Check Response Status Code 200 ${response.status_code} + Check Context Response Kind ${response.json()} Cached + + Stop @context Local Server + + ${response}= Delete a @context ${uri} true + Check Response Status Code 503 ${response.status_code} + +Delete Initial @context condition from an external server + Log Delete initial contidions + Delete Entity by Id ${entity_context_id} + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot new file mode 100644 index 0000000000000000000000000000000000000000..07189824ce20330c9dac5b606d8f3565769f9b3c --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot @@ -0,0 +1,69 @@ +*** Settings *** +Documentation Check that the numberOfHits is increased after using a Cached context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Resource ${EXECDIR}/resources/ContextServerUtils.resource +Library Collections +Library String +Variables ${EXECDIR}/resources/variables.py +Library HttpCtrl.Client +Library HttpCtrl.Server + +Test Setup Create Initial @context condition from an external server +Test Teardown Delete Initial @context condition from an external server + + +*** Variables *** +${filename}= @context-minimal-valid.json +${entityfile}= minimal-entity-using-@context.jsonld +${uri} /api/v1/context.jsonld +${reason_200}= OK +${testing_id_prefix}= urn:ngsi-ld:Testing: + + +*** Test Cases *** +053_06_01 Check that the numberOfHits is increased after using a Cached context + [Documentation] Check that the numberOfHits is increased after using a Cached context + [Tags] ctx-serve 5_13_4 since_v1.5.1 + + ${second_existing_entity_id}= Generate Random Entity Id ${testing_id_prefix} + Set Global Variable ${first_existing_entity_id} + + Create Entity selecting @context ${entityfile} ${uri} ${second_existing_entity_id} + + ${response}= Serve a @context + ... contextId=${uri} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Context Response Body Containing numberOfHits value ${response.json()} 2 + + +*** Keywords *** +Create Initial @context condition from an external server + Start @context Local Server + + ${first_existing_entity_id}= Generate Random Entity Id ${testing_id_prefix} + Set Global Variable ${first_existing_entity_id} + + ${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} + Set Global Variable ${uri} + + Create Entity selecting @context ${entityfile} ${uri} ${first_existing_entity_id} + + ${response}= Serve a @context + ... contextId=${uri} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Context Response Body Containing numberOfHits value ${response.json()} 1 + +Delete Initial @context condition from an external server + Log Delete initial contidions + Delete Entity by Id ${first_existing_entity_id} + Delete a @context ${uri} + Stop @context Local Server diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot new file mode 100644 index 0000000000000000000000000000000000000000..ab9a82da891872bbff1ec82363555dfd680d5d26 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot @@ -0,0 +1,80 @@ +*** Settings *** +Documentation Check that we can serve a ImplicitlyCreated @context with details set to true + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create initial ImplicitlyCreated @context +Test Teardown Delete Initial @context Data + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld +${reason_200}= OK + + +*** Test Cases *** +053_07_01 Check that we can serve a ImplicitlyCreated @context with details set to true + [Documentation] Check that we can serve a ImplicitlyCreated @context with details set to true + [Tags] sub-create 5_13_4 since_v1.5.1 + + ${response}= Serve a @context + ... contextId=${implicit_id} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_200} + Check Response Headers Containing Content-Type set to ${CONTENT_TYPE_JSON} ${response.headers} + + # Check mandatory keys in the response (URL, localId, kind, timestamp) and their possible values + Check Context Response Body Containing Detailed Information ${response.json()} ImplicitlyCreated + + # Check optional keys in the response (lastUsage, numberOfHits, extraInfo) and their possible values + Check Response Body Might Contain Optional Fields ${response.json()} lastUsage + Check Response Body Might Contain Optional Fields ${response.json()} numberOfHits + Check Response Body Might Contain Optional Fields ${response.json()} extraInfo + + # Check that there is no other keys + Check Context Detailed Information Keys ${response.json()} + + # We need to check the list of responses + # Check Context Response Body Containing a JSONObject with details of a ImplicitlyCreated @contexts + # ... response=${response.json()} + # ... expected_length=1 + + +*** Keywords *** +Create initial ImplicitlyCreated @context + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + + Set Global Variable ${implicit_id} + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END + Delete a @context ${implicit_id} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot new file mode 100644 index 0000000000000000000000000000000000000000..74a9534a389d0a27b214a85cd36212d3421d1649 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot @@ -0,0 +1,73 @@ +*** Settings *** +Documentation Check that the numberOfHits is increased after using a ImplicitlyCreated context + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create initial ImplicitlyCreated @context +Test Teardown Delete Initial @context Data + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld +${testing_id_prefix}= urn:ngsi-ld:Testing: +${entityfile}= minimal-entity-using-@context.jsonld + + +*** Test Cases *** +053_08_01 Check that the numberOfHits is increased after using a ImplicitlyCreated context + [Documentation] Check that the numberOfHits is increased after using a ImplicitlyCreated context + [Tags] ctx-serve 5_13_4 since_v1.5.1 + + ${entity_id}= Generate Random Entity Id ${testing_id_prefix} + Set Global Variable ${entity_id} + + Create Entity selecting @context ${entityfile} ${implicit_id} ${entity_id} + + ${response}= Serve a @context + ... contextId=${implicit_id} + ... details=true + + Check Response Status Code 200 ${response.status_code} + Check Context Response Body Containing numberOfHits value ${response.json()} 2 + + +*** Keywords *** +Create initial ImplicitlyCreated @context + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + + Check Context Response Body Containing numberOfHits value ${data} 1 + + Set Global Variable ${implicit_id} + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END + Delete a @context ${implicit_id} + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_01.robot b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..c33d447576610dfef07e07b783c97b91708b6a0c --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_01.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check that you can add a hosted @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Variables ${EXECDIR}/resources/variables.py + +Test Teardown Delete Initial @context +Test Template Add a valid @context + + +*** Variables *** +${filename_dictionary}= @context-minimal-valid.json +${filename_list}= @context-cached-valid.json +${reason_201}= Created +${reason_204}= No Content + + +*** Test Cases *** FILENAME CONTEXT_TYPE +050_01_01 Add a valid hosted @context from key=value + [Tags] ctx-add 5_13_2 since_v1.5.1 + ${filename_dictionary} Hosted +050_01_02 Add a valid cached @context from URI + [Tags] ctx-add 5_13_2 since_v1.5.1 + ${filename_list} Hosted + + +*** Keywords *** +Add a valid @context + [Documentation] Check that you can add a @context + [Arguments] ${filename} ${context_type} + + ${response}= Add a new @context ${filename} + + Check Response Status Code 201 ${response.status_code} + Check Response Does Not Contain Body ${response} + Check Response Reason set to ${response.reason} ${reason_201} + + Dictionary Should Contain Key ${response.headers} Location msg=HTTP Headers do not contain key 'Location' + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + + Log URI: ${uri} + + # Need to check that the kind value of the created context is "hosted" + ${response_serve}= Serve a @context ${uri} true + Check Response Kind set to ${response_serve.json()} ${context_type} + + Log URI: ${response_serve} + +Delete Initial @context + ${response}= List @contexts true ${EMPTY} + # We need to extract all the contexts except the core context and delete them + FOR ${item} IN @{response.json()} + ${uri}= Get From Dictionary ${item} URL + IF '${uri}'=='${core_context}' + Log WARNING, Trying to delete the Core Context + ELSE + Delete a @context ${uri} + END + END diff --git a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_02.robot b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..926bcdf87912345cbf1f79de033c53780ea05744 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_02.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you receive a 400 Bad Request creating a @context if the content is incorrect + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Teardown Delete @context if it was created by error +Test Template Add @context scenarios + + +*** Variables *** +${wrong_context_filename}= @context-incorrect.json +${wrong_json_filename}= @context-wrong-json.json +${reason_400}= Bad Request +${problem_type}= https://uri.etsi.org/ngsi-ld/errors/InvalidRequest + + +*** Test Cases *** FILENAME REASON +050_02_01 Checking Incorrect Payload + [Tags] ctx-add 5_13_2 since_v1.5.1 + ${wrong_context_filename} ${reason_400} +050_02_02 Checking Wrong JSON + [Tags] ctx-add 5_13_2 since_v1.5.1 + ${wrong_json_filename} ${reason_400} + + +*** Keywords *** +Add @context scenarios + [Documentation] Check that the payload include "@context" + [Arguments] ${filename} ${reason} + + ${response}= Add a new @context ${filename} + Set Suite Variable ${response} + + Check Response Status Code 400 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason} + + Check Response Body Containing ProblemDetails Element ${response.json()} ${problem_type} + +Delete @context if it was created by error + IF '${response.status_code}'!='400' + ${uri}= Fetch Id From Response Location Header ${response.headers} + Delete a @context ${uri} + END diff --git a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_03.robot b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..a1b44b9cc406f11b3ebcb93ddc508105332347c5 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_03.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can create a implicitlycreated @context through creating a subscription + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Initial @context Data + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld + + +*** Test Cases *** +050_03_01 Check the creation of ImplicitelyCreted @context + [Documentation] Check that you can create a subscription + [Tags] sub-create 5_13_2 since_v1.5.1 + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + Set Global Variable ${implicit_id} + + Check Response Kind set to ${data} ImplicitlyCreated + + +*** Keywords *** +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END + Delete a @context ${implicit_id} diff --git a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..8ef82135bd7bb073e68ae55f605bf22a3d16f4d2 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that you can add a hosted @context with list of URIs and each of them are cached @coxtexts + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Teardown Delete Initial @context + + +*** Variables *** +${filename_list}= @context-cached-valid.json +${reason_201}= Created +${reason_204}= No Content + + +*** Test Cases *** +050_04_01 Add a valid hosted @context with URIs and check that the URIs are Cached @contexts + [Documentation] Check that you can add a @context + [Tags] ctx-add 5_13_2 since_v1.5.1 + + ${response}= Add a new @context ${filename_list} + + Check Response Status Code 201 ${response.status_code} + Check Response Does Not Contain Body ${response} + Check Response Reason set to ${response.reason} ${reason_201} + + Dictionary Should Contain Key ${response.headers} Location msg=HTTP Headers do not contain key 'Location' + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + + Log URI: ${uri} + + # Need to check that the kind value of the created context is "hosted" + ${response_serve}= Serve a @context ${uri} true + Check Response Kind set to ${response_serve.json()} Hosted + + # Need to check that each of the URIs are Cached @contexts + Check Cached @Contexts ${filename_list} + + +*** Keywords *** +Delete Initial @context + ${response}= List @contexts true ${EMPTY} + # We need to extract all the contexts except the core context and delete them + FOR ${item} IN @{response.json()} + ${uri}= Get From Dictionary ${item} URL + IF '${uri}'=='${core_context}' + Log WARNING, Trying to delete the Core Context + ELSE + Delete a @context ${uri} + END + END diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_01.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..4bf1b55d34f2364b8ab21866135c653027bb6c1c --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_01.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can delete a previous created hosted @context without reload param + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial hosted @context + + +*** Variables *** +${filename}= @context-minimal-valid.json +${reason_204}= No Content + + +*** Test Cases *** +051_01_01 Delete a @context whose kind is hosted without reload param + [Documentation] Check that you can delete a hosted @context + [Tags] ctx-serve 5_13_5 since_v1.5.1 + + ${response}= Delete a @context ${uri} + + Check Response Status Code 204 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_204} + Check Response Does Not Contain Body ${response} + + +*** Keywords *** +Create Initial hosted @context + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_02.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..14761acb0a917c07295634ed73026f5f5fe460dd --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_02.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you get an error when trying to delete an unknown @context identifier + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + + +*** Variables *** +${reason_404}= Not Found + + +*** Test Cases *** +051_02_01 Delete a @context with unknown @context identifier + [Documentation] Check that an error message is obtained in the response when we try to delete a @context with unknonwn id + [Tags] ctx-serve 5_13_5 since_v1.5.1 + + ${random_url}= Generate Random String 16 [NUMBERS] + ${response}= Delete a @context ${random_url} + + Check Response Status Code 404 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_404} + + Check Response Body Containing ProblemDetails Element ${response.json()} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..5ca2ef6f89c2246c0f7c16080bc6696f3103fb0f --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can delete a previous created cached @context without reload param + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial cached @context +Test Teardown Delete Initial @context + + +*** Variables *** +${filename}= @context-cached-one-valid.json +${reason_204}= No Content + + +*** Test Cases *** +051_03_01 Delete a @context whose kind is cached without reload param + [Documentation] Check that you can delete a cached @context + [Tags] ctx-serve 5_13_5 since_v1.5.1 + + ${response}= Delete a @context ${contextId} + + Check Response Status Code 204 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_204} + Check Response Does Not Contain Body ${response} + + +*** Keywords *** +Create Initial cached @context + ${entity_payload}= Load JSON From File ${EXECDIR}/data/jsonldContext/${filename} + ${contextId}= Get From Dictionary ${entity_payload} @context + ${contextId}= Get From List ${contextId} 0 + + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + + ${response}= Serve a @context ${contextId} true + Check Response Kind set to ${response.json()} Cached + + Set Global Variable ${contextId} + +Delete Initial @context + ${response}= List @contexts true ${EMPTY} + # We need to extract all the contexts except the core context and delete them + FOR ${item} IN @{response.json()} + ${uri}= Get From Dictionary ${item} URL + IF '${uri}'=='${core_context}' + Log WARNING, Trying to delete the Core Context + ELSE + Delete a @context ${uri} + END + END diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_04.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_04.robot new file mode 100644 index 0000000000000000000000000000000000000000..e73fbb7fcafe164f5c1c71024c1c86a750272c09 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_04.robot @@ -0,0 +1,56 @@ +*** Settings *** +Documentation Check that you get an error when try to delete a @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create Initial @context +Test Teardown Delete Initial @context +Test Template Delete a @context with wrong data + + +*** Variables *** +${filename}= @context-minimal-valid.json +${cached_id}= https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld +${reason_400}= Bad Request +${reason_404}= Not Found +${reason_422}= Unprocessable + + +*** Test Cases *** CONTEXTID RELOAD STATUSCODE REASON ERROR +051_04_01 Delete a @contexts with a wrong id and reload set to true + [Tags] ctx-delete 5_13_5 since_v1.5.1 + wrong_id_context true 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +051_04_02 Delete a @contexts with a wrong id and reload set to false + [Tags] ctx-delete 5_13_5 since_v1.5.1 + wrong_id_context false 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +051_04_03 Delete a @contexts with a wrong id and no reload value + [Tags] ctx-delete 5_13_5 since_v1.5.1 + wrong_id_context ${EMPTY} 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +051_04_04 Delete a @contexts with a wrong id and wrong reload value + [Tags] ctx-delete 5_13_5 since_v1.5.1 + wrong_id_context xxx 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +051_04_05 Delete a Hosted @contexts with a valid id and reload set to true + [Tags] ctx-delete 5_13_5 since_v1.5.1 + ${uri} true 400 ${reason_400} ${ERROR_TYPE_BAD_REQUEST_DATA} + + +*** Keywords *** +Delete a @context with wrong data + [Documentation] Check that you can delete a hosted @context + [Arguments] ${contextid} ${reload} ${statuscode} ${reason} ${error} + ${response}= Delete a @context ${contextid} ${reload} + + Check Response Status Code ${statuscode} ${response.status_code} + Check Response Reason set to ${response.reason} ${reason} + Check Response Body Containing ProblemDetails Element ${response.json()} ${error} + +Create Initial @context + ${response}= Add a new @context ${filename} + Check Response Status Code 201 ${response.status_code} + ${uri}= Fetch Id From Response Location Header ${response.headers} + Set Suite Variable ${uri} + +Delete Initial @context + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..a1add01e888905b71d059d3d2cf04b27264b28fd --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check that you get an error if we created an entity with a context (Cached context) and we try to delete it with reload=true + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Resource ${EXECDIR}/resources/ContextServerUtils.resource +Library Collections +Library String +Variables ${EXECDIR}/resources/variables.py +Library HttpCtrl.Client +Library HttpCtrl.Server + +Test Setup Create Initial @context condition from an external server +Test Teardown Delete Initial @context condition from an external server + + +*** Variables *** +${filename}= @context-minimal-valid.json +${entityfile}= minimal-entity-using-@context.jsonld +${entity_context_id}= urn:ngsi-ld:Testing:randomUUID +${uri} /api/v1/context.jsonld + + +*** Test Cases *** +051_05_01 Delete and Reload a Cached @context with no communication with the Context Server + [Documentation] Check that you get an error if we try to reload a cached context with no communication with the context server + [Tags] ctx-serve 5_13_5 since_v1.5.1 + + ${response}= Delete a @context ${uri} true + + Check Response Status Code 503 ${response.status_code} + Check Response Reason set to ${response.reason} Service Unavailable + Check Response Body Containing ProblemDetails Element + ... ${response.json()} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + + +*** Keywords *** +Create Initial @context condition from an external server + Start @context Local Server + + ${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} + Set Global Variable ${uri} + + Create Entity selecting @context ${entityfile} ${uri} + + Log Waiting 3 seconds to continue... + Sleep 3s + + ${response}= Serve a @context ${uri} true + Check Response Status Code 200 ${response.status_code} + Check Context Response Kind ${response.json()} Cached + + Stop @context Local Server + +Delete Initial @context condition from an external server + Log Delete initial contidions + Delete Entity by Id ${entity_context_id} + Delete a @context ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot new file mode 100644 index 0000000000000000000000000000000000000000..57802432d4efef648129d0e81c6c381fd1bdaa63 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot @@ -0,0 +1,63 @@ +*** Settings *** +Documentation Delete a @context whose kind is ImplicitlyCreated without reload param + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Setup Create initial ImplicitlyCreated @context +Test Teardown Delete Initial @context Data + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld +${reason_204}= No Content + + +*** Test Cases *** +051_06_01 Delete a @context whose kind is ImplicitlyCreated without reload param + [Documentation] Check that we can delete a ImplicitlyCreated @context + [Tags] ctx-serve 5_13_5 since_v1.5.1 + + ${response}= Delete a @context ${implicit_id} + + Check Response Status Code 204 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_204} + Check Response Does Not Contain Body ${response} + + +*** Keywords *** +Create initial ImplicitlyCreated @context + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + + Check Context Response Body Containing numberOfHits value ${data} 1 + + Set Global Variable ${implicit_id} + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_07.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_07.robot new file mode 100644 index 0000000000000000000000000000000000000000..cbbb816af9f87c8c37a6729a2c926a163f7249cc --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_07.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation Check that you cannot delete a ImplicitlyCreated @context with reload set to true + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource + +Test Setup Create initial ImplicitlyCreated @context +Test Teardown Delete Initial @context Data + + +*** Variables *** +${subscription_payload_file_path}= jsonldContext/subscription-with-implicitlycreated-contexts.jsonld +${reason_400}= Bad Request + + +*** Test Cases *** +051_07_01 Delete a ImplicitlyCreated @contexts with a valid id and reload set to true + [Documentation] Check that you cannot delete a ImplicitlyCreated @context with reload set to true + [Tags] ctx-delete 5_13_5 since_v1.5.1 + + ${response}= Delete a @context ${implicit_id} true + + Check Response Status Code 400 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_400} + Check Response Body Containing ProblemDetails Element ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + + +*** Keywords *** +Create initial ImplicitlyCreated @context + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} + + ${subscription_id}= Get Value From JSON ${subscription_payload} $..id + ${subscription_id}= Get From List ${subscription_id} 0 + + ${list_contexts}= Get Value From JSON ${subscription_payload} $..@context + ${list_contexts}= Get From List ${list_contexts} 0 + + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + + ${response}= List @contexts true ImplicitlyCreated + + Check Response Status Code 200 ${response.status_code} + + ${data}= Get From List ${response.json()} 0 + ${implicit_id}= Get From Dictionary ${data} URL + + Set Global Variable ${implicit_id} + Set Suite Variable ${subscription_id} + Set Suite Variable ${list_contexts} + +Delete Initial @context Data + Delete Subscription ${subscription_id} + FOR ${uri} IN @{list_contexts} + Log URI: ${uri} + Delete a @context ${uri} + END + Delete a @context ${implicit_id} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_08.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_08.robot new file mode 100644 index 0000000000000000000000000000000000000000..ccf461e792d8eb927be305a60a4b61db512abb1b --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_08.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you get an error when try to delete the core @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Test Template Delete a core @context + + +*** Variables *** +${reason_400}= Bad Request +${type}= https://uri.etsi.org/ngsi-ld/errors/BadRequestData + + +*** Test Cases *** RELOAD +051_08_01 Delete a core @contexts and return an error with no reload + [Tags] ctx-delete 5_13_5 since_v1.5.1 + ${EMPTY} +051_08_02 Delete a core @contexts and return an error with reload set to false + [Tags] ctx-delete 5_13_5 since_v1.5.1 + false + + +*** Keywords *** +Delete a core @context + [Documentation] Check that you get an error when try to delete the core @context + [Arguments] ${reload} + + ${response}= Delete a @context ${core_context} ${reload} + + Check Response Status Code 400 ${response.status_code} + Check Response Reason set to ${response.reason} ${reason_400} + Check Response Body Containing ProblemDetails Element ${response.json()} ${type} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_09.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_09.robot new file mode 100644 index 0000000000000000000000000000000000000000..c36c2156fadccd14f3713754f5af04b2157f0cf0 --- /dev/null +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_09.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you get an error when try to delete the core @context + +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Variables ${EXECDIR}/resources/variables.py + +Test Setup Delete core context and reload it + + +*** Variables *** +${reason_400}= Bad Request +${reason_404}= Not Found +${reason_422}= Unprocessable +${type}= https://uri.etsi.org/ngsi-ld/errors/BadRequestData + + +*** Test Cases *** +051_09_01 Delete a core @contexts with reload set to true and check if the context has been download again by the broker + [Documentation] Delete a core @contexts with reload set to true and check downloaded core context + [Tags] ctx-delete 5_13_5 since_v1.5.1 + # TODO: There is something to change in the spec to faciliate checking if the core context was really updated + + ${response}= Serve a @context + ... contextId=${core_context} + ... details=true + + Check Response Status Code 200 ${response.status_code} + + +*** Keywords *** +Delete core context and reload it + ${response}= Serve a @context + ... contextId=${core_context} + ... details=true + Check Response Status Code 200 ${response.status_code} + + ${response}= Delete a @context ${core_context} true + Check Response Status Code 204 ${response.status_code} diff --git a/data/jsonldContext/@context-cached-one-valid.json b/data/jsonldContext/@context-cached-one-valid.json new file mode 100644 index 0000000000000000000000000000000000000000..98d492f7ad9c6fed457c214b2e4e6168c00eaae5 --- /dev/null +++ b/data/jsonldContext/@context-cached-one-valid.json @@ -0,0 +1,5 @@ +{ + "@context": [ + "http://smartdatamodels.org/context.jsonld" + ] +} diff --git a/data/jsonldContext/@context-cached-valid.json b/data/jsonldContext/@context-cached-valid.json new file mode 100644 index 0000000000000000000000000000000000000000..6a1134975a87b022f0fefd5e4edaa7e912d382b6 --- /dev/null +++ b/data/jsonldContext/@context-cached-valid.json @@ -0,0 +1,6 @@ +{ + "@context": [ + "http://smartdatamodels.org/context.jsonld", + "https://fiware.github.io/data-models/context.jsonld" + ] +} diff --git a/data/jsonldContext/@context-duplicated-key.json b/data/jsonldContext/@context-duplicated-key.json new file mode 100644 index 0000000000000000000000000000000000000000..2f5d5a43783d6ea114ee52e245e853640068a72d --- /dev/null +++ b/data/jsonldContext/@context-duplicated-key.json @@ -0,0 +1,7 @@ +{ + "@context": { + "A1": "urn:ngsi-ld:attributes:A1", + "A1": "urn:ngsi-ld:attributes:A2", + "A3": "urn:ngsi-ld:attributes:A3" + } +} diff --git a/data/jsonldContext/@context-incorrect.json b/data/jsonldContext/@context-incorrect.json new file mode 100644 index 0000000000000000000000000000000000000000..d9ed4a108d8dc53fb11869675ec6f7f31b18c2e0 --- /dev/null +++ b/data/jsonldContext/@context-incorrect.json @@ -0,0 +1,5 @@ +{ + "A1": "urn:ngsi-ld:attributes:A1", + "A2": "urn:ngsi-ld:attributes:A2", + "A3": "urn:ngsi-ld:attributes:A3" +} diff --git a/data/jsonldContext/@context-minimal-second-valid.json b/data/jsonldContext/@context-minimal-second-valid.json new file mode 100644 index 0000000000000000000000000000000000000000..ccd1b9d56abe73a8b67b8f59de83ddf7c303de85 --- /dev/null +++ b/data/jsonldContext/@context-minimal-second-valid.json @@ -0,0 +1,7 @@ +{ + "@context": { + "B1": "urn:ngsi-ld:attributes:B1", + "B2": "urn:ngsi-ld:attributes:B2", + "B3": "urn:ngsi-ld:attributes:B3" + } +} diff --git a/data/jsonldContext/@context-minimal-third-valid.json b/data/jsonldContext/@context-minimal-third-valid.json new file mode 100644 index 0000000000000000000000000000000000000000..c20f85188a16cb3beb7eaa136450bdd3b91ba7bd --- /dev/null +++ b/data/jsonldContext/@context-minimal-third-valid.json @@ -0,0 +1,7 @@ +{ + "@context": { + "C1": "urn:ngsi-ld:attributes:C1", + "C2": "urn:ngsi-ld:attributes:C2", + "C3": "urn:ngsi-ld:attributes:C3" + } +} diff --git a/data/jsonldContext/@context-minimal-valid.json b/data/jsonldContext/@context-minimal-valid.json new file mode 100644 index 0000000000000000000000000000000000000000..1acfdee0ac387a87d5b6b0c498db13a681c835d4 --- /dev/null +++ b/data/jsonldContext/@context-minimal-valid.json @@ -0,0 +1,7 @@ +{ + "@context": { + "A1": "urn:ngsi-ld:attributes:A1", + "A2": "urn:ngsi-ld:attributes:A2", + "A3": "urn:ngsi-ld:attributes:A3" + } +} diff --git a/data/jsonldContext/@context-wrong-json.json b/data/jsonldContext/@context-wrong-json.json new file mode 100644 index 0000000000000000000000000000000000000000..af29c92423b5d1a52ceaaab5f091f886fef356ad --- /dev/null +++ b/data/jsonldContext/@context-wrong-json.json @@ -0,0 +1,5 @@ +{ + "A1": "urn:ngsi-ld:attributes:A1" + "A2": "urn:ngsi-ld:attributes:A2" + "A3": "urn:ngsi-ld:attributes:A3" +} diff --git a/data/jsonldContext/expected-detailed-@context.json b/data/jsonldContext/expected-detailed-@context.json new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/jsonldContext/minimal-entity-using-@context.jsonld b/data/jsonldContext/minimal-entity-using-@context.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..143e7e332ae90d8cc5dd2bf1a44f0035f3b69c69 --- /dev/null +++ b/data/jsonldContext/minimal-entity-using-@context.jsonld @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:Testing:randomUUID", + "type": "Testing", + "A1": "value of A1", + "A2": "value of A2", + "A3": "value of A3", + "@context": [ + "ContextURI" + ] +} \ No newline at end of file diff --git a/data/jsonldContext/subscription-with-implicitlycreated-contexts.jsonld b/data/jsonldContext/subscription-with-implicitlycreated-contexts.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..6df8fa7092eb6cab7274d6cdbd9b8d60cedb4af3 --- /dev/null +++ b/data/jsonldContext/subscription-with-implicitlycreated-contexts.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:subscriptions:01", + "type": "Subscription", + "entities": [ + { + "type": "T1" + } + ], + "notification": { + "endpoint": { + "uri": "http://a.b.c/123" + } + }, + "@context": [ + "https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testContext.jsonld", + "http://smartdatamodels.org/context.jsonld" + ] +} \ No newline at end of file diff --git a/doc/README.md b/doc/README.md index aee525a52dc2975ea3db365aa07d94cd3e6b6420..a4d2d1a1d01ea997b426e833b4a031fe255f70e3 100644 --- a/doc/README.md +++ b/doc/README.md @@ -19,14 +19,24 @@ requirements and python virtual environment already defined in [README.md](../RE The unit tests where divided into several groups following the NGSI-LD Test Suite Structure (ETSI RGS CIM 012) divided in test groups and subgroups: -- Group 1: Context Information (CI), Provision (PROV), defined in the [test_ContextInformation_Provision.py](./tests/test_ContextInformation_Provision.py) file. -- Group 2: Context Information (CI), Consumption (CONS), defined in the [test_ContextInformation_Consumption.py](./tests/test_ContextInformation_Consumption.py) file. -- Group 3: Context Information (CI), Subscription (SUB), defined in the [test_ContextInformation_Subscription.py](./tests/test_ContextInformation_Subscription.py) file. -- Group 4: Context Source (CS), Registration (REG), defined in the [test_ContextSource_Registration.py](./tests/test_ContextSource_Registration.py) file. -- Group 5: Context Source (CS), Discovery (DISC), defined in the [test_ContextSource_Discovery.py](./tests/test_ContextSource_Discovery.py) file. +- Group 1: Context Information (CI), Provision (PROV), defined in the +[test_ContextInformation_Provision.py](./tests/test_ContextInformation_Provision.py) file. +- Group 2: Context Information (CI), Consumption (CONS), defined in the +[test_ContextInformation_Consumption.py](./tests/test_ContextInformation_Consumption.py) file. +- Group 3: Context Information (CI), Subscription (SUB), defined in the +[test_ContextInformation_Subscription.py](./tests/test_ContextInformation_Subscription.py) file. +- Group 4: Context Source (CS), Registration (REG), defined in the +[test_ContextSource_Registration.py](./tests/test_ContextSource_Registration.py) file. +- Group 5: Context Source (CS), Discovery (DISC), defined in the +[test_ContextSource_Discovery.py](./tests/test_ContextSource_Discovery.py) file. - Group 6: Context Source (CS), Registration Subscription (REGSUB), defined in the [test_ContextSource_RegistrationSubscription.py](./tests/test_ContextSource_RegistrationSubscription.py) file. -- Group 7: Common Behaviours (CB), defined in the [test_CommonBehaviours.py]() file. +- Group 7: Common Behaviours (CB), defined in the +[test_CommonBehaviours.py](./tests/test_CommonBehaviours.py) file. +- Group 8: Storing, Managing and Serving @contexts (CTX), Consumption (CONS), defined in the +[test_jsonldContext_Consumption.py](./tests/test_jsonldContext_Consumption.py) file. +- Group 9: Storing, Managing and Serving @contexts (CTX), Provision (PROV), defined in the +[test_jsonldContext_Provision.py](./tests/test_jsonldContext_Provision.py) file. Additionally, a specific unit test called [test_CheckTests.py](./tests/test_CheckTests.py) was created to check that all robot files have the corresponding unit tests. @@ -37,6 +47,8 @@ divided into the NGSI-LD Test Suite Structure groups: - [CommonBehaviours](./files/CommonBehaviours) contains the expected results of the Common Behaviours robot files. - [ContextInformation](./files/ContextInformation) contains the expected results of the Context Information files. - [ContextSource](./files/ContextSource) contains the expected results of the Context Source files. +- [jsonldContext](./files/jsonldContext) contains the expected results of the Storing, Managing and Serving @contexts +files. ## Execution @@ -59,6 +71,10 @@ files. robot files. - [ContextSource RegistrationSubscription Unit Tests](../.idea/runConfigurations/ContextSource_RegistrationSubscription_Unit_Tests.xml) executes Context Source - Registration Subscription unit tests associated to the robot files. +- [jsonldContext Consumption Unit Tests](../.idea/runConfigurations/jsonldContext_Consumption_Unit_Tests.xml) executes Storing, Managing and Serving @contexts - Consumption unit tests +associated to the robot files. +- [jsonldContext Provision Unit Tests](../.idea/runConfigurations/jsonldContext_Provision_Unit_Tests.xml) executes Storing, Managing and Serving @contexts - Provision unit tests +associated to the robot files. - [Generate Documentation Data](../.idea/runConfigurations/Generate_Documentation_Data.xml) executes Generate Document Data unit tests associated to the unit test execution of a specific robot file (e.g. 047_01). The generated files are located in the [results](./results) folder. diff --git a/doc/analysis/checks.py b/doc/analysis/checks.py index 89fd93cf5431311a8daf4d8ab93d4611d4143d22..ec9a873d5bbe93dfcb4852d6ab9c0830a447bf0b 100644 --- a/doc/analysis/checks.py +++ b/doc/analysis/checks.py @@ -64,8 +64,10 @@ class Checks: Checks.check_response_body_contains_datetime_value, 'Check Response Body Containing ProblemDetails Element Containing Title Element': Checks.check_response_body_containing_problemdetails_element_containing_title_element, - 'Check Dictionary Might Contain Additional Members of the NotificationParams': - Checks.check_dictionary_might_contain_additional_members, + 'Check Response Body Might Contain Additional Members of the NotificationParams': + Checks.check_response_body_might_contain_additional_members_notification_params, + 'Check Response Body Might Contain Optional Fields': + Checks.check_response_body_might_contain_optional_fields, 'Check Response Body Containing ProblemDetails Element': Checks.check_response_body_containing_problemdetails_element, 'Check RL Response Body Containing ProblemDetails Element Containing Type Element set to': @@ -114,6 +116,22 @@ class Checks: Checks.check_response_reason_set_to, 'Check Response Does Not Contain Body': Checks.check_response_does_not_contain_body, + 'Check Context Response Body Containing a list of identifiers': + Checks.check_context_response_body_containing_a_list_of_identifiers, + 'Check Context Response Body Containing a JSONObject with details of the @contexts': + Checks.check_context_response_body_containing_a_jsonobject_with_details_of_the_contexts, + 'Check Context Response Body Content': + Checks.check_context_response_body_content, + 'Check Context Response Body Containing Detailed Information': + Checks.check_context_response_body_containing_detailed_information, + 'Check Context Detailed Information Keys': + Checks.check_context_detailed_information_keys, + 'Check Context Response Body Containing numberOfHits value': + Checks.check_context_response_body_containing_numberofhits_value, + 'Check Response Kind set to': + Checks.check_response_kind_set_to, + 'Check Cached @Contexts': + Checks.check_cached_contexts, 'Check Response Header is Empty': Checks.check_response_header_is_empty, 'Check Response Headers Link set to': @@ -149,13 +167,17 @@ class Checks: }, 'Check Updated Resource Set To': { 'params': ['updated_resource', 'response_body', 'ignored_keys'], - 'position': [0] + 'position': [] }, 'Check Response Body Containing ProblemDetails Element Containing Title Element': { 'params': ['response_body'], 'position': [0] }, - 'Check Dictionary Might Contain Additional Members of the NotificationParams': { + 'Check Response Body Might Contain Additional Members of the NotificationParams': { + 'params': ['dictionary', 'key'], + 'position': [0, 1] + }, + 'Check Response Body Might Contain Optional Fields': { 'params': ['dictionary', 'key'], 'position': [0, 1] }, @@ -333,6 +355,38 @@ class Checks: 'params': ['response'], 'position': [0] }, + 'Check Context Response Body Containing a list of identifiers': { + 'params': ['response_body', 'expected_length', 'list_contexts', 'kind'], + 'position': [] + }, + 'Check Context Response Body Containing a JSONObject with details of the @contexts': { + 'params': ['response', 'expected_length', 'list_contexts'], + 'position': [0, 1, 2] + }, + 'Check Context Response Body Content': { + 'params': ['expectation_filename', 'response_body'], + 'position': [0, 1] + }, + 'Check Context Response Body Containing Detailed Information': { + 'params': ['response_body', 'context_type'], + 'position': [0, 1] + }, + 'Check Context Detailed Information Keys': { + 'params': ['my_dict'], + 'position': [0] + }, + 'Check Context Response Body Containing numberOfHits value': { + 'params': ['response_body', 'expected_number_of_hists'], + 'position': [0, 1] + }, + 'Check Response Kind set to': { + 'params': ['response', 'kind'], + 'position': [0, 1] + }, + 'Check Cached @Contexts': { + 'params': ['context'], + 'position': [0] + }, 'Check Response Header is Empty': { 'params': ['response_headers'], 'position': [0] @@ -458,7 +512,39 @@ class Checks: if 'dictionary' in kwargs and 'key' in kwargs: return f"The dictionary `{kwargs['dictionary']}' should contain the key '{kwargs['key']}'" else: - raise Exception(f'ERROR, Expected dictionary and key parameters but received: {kwargs}') + raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") + + @staticmethod + def check_context_response_body_content(kwargs: list) -> str: + if 'expectation_filename' in kwargs and 'response_body' in kwargs: + return f"Check the Body of the response should contain the @context `{kwargs['expectation_filename']}'" + else: + raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") + + @staticmethod + def check_context_response_body_containing_detailed_information(kwargs: list) -> str: + if 'response_body' in kwargs and 'context_type' in kwargs: + return (f"Check the Body of the response should contain a @context " + f"with 'URL' key not Empty and 'string' type, " + f"with 'localId' key not Empty and 'string' type, " + f"with 'kind' key not Empty, 'string' type, and value set to '{kwargs['context_type']}', " + f"and 'timestamp and 'DateTime' format") + else: + raise Exception(f"ERROR, Expected 'response_body' and 'context_type' parameters but received: {kwargs}") + + @staticmethod + def check_response_body_might_contain_additional_members_notification_params(kwargs: list) -> str: + if 'dictionary' in kwargs and 'key' in kwargs: + return f"The Response Body `{kwargs['dictionary']}' might contain the key '{kwargs['key']}' in the NotificationParams" + else: + raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") + + @staticmethod + def check_response_body_might_contain_optional_fields(kwargs: list) -> str: + if 'dictionary' in kwargs and 'key' in kwargs: + return f"The Response Body `{kwargs['dictionary']}' might contain the key '{kwargs['key']}'" + else: + raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") @staticmethod def should_not_be_empty(kwargs: list) -> str: @@ -503,13 +589,6 @@ class Checks: def check_response_headers_id_not_empty(kwargs: list) -> str: return 'Response Header: Location is not Empty' - @staticmethod - def check_dictionary_might_contain_additional_members(kwargs: list) -> str: - if 'dictionary' in kwargs and 'key' in kwargs: - return f"The dictionary `{kwargs['dictionary']}' might contain the key '{kwargs['key']}'" - else: - raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}") - @staticmethod def check_response_body_containing_an_attribute_set_to(kwargs: list) -> str: expected_parameters = ['checks', 'expected_attribute_name', 'response_body', 'expected_attribute_value'] @@ -533,6 +612,58 @@ class Checks: return response + @staticmethod + def check_context_response_body_containing_a_list_of_identifiers(kwargs: list) -> str: + expected_parameters = ['response_body', 'expected_length', 'list_contexts', 'kind'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Context Response Body Containing a list of identifiers" + for key, value in kwargs.items(): + match key: + case 'response_body': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'expected_length': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'list_contexts': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'kind': + response = f"{response} and\n Query Parameter: {key} set to '{value}'" + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def check_context_response_body_containing_a_jsonobject_with_details_of_the_contexts(kwargs: list) -> str: + if 'response' in kwargs and 'expected_length' in kwargs and 'list_contexts' in kwargs: + return (f"Response Body containing a Context element containing JSONObject with details of the contexts:\n" + f" * the expected length of contexts set to '{kwargs['expected_length']}'\n" + f" * the list of contexts URI set to '{kwargs['list_contexts']}'\n" + f" * response body to be checked set to '{kwargs['response']}'") + else: + raise Exception(f"ERROR, expected 'filename', 'temporal_entity_representation_id', and 'response_body' " + f"attributes, received: '{kwargs}'") + + @staticmethod + def check_context_detailed_information_keys(kwargs: list) -> str: + return (f"Check that the only allowed keys in the response body of a @context are 'URL', 'localId', 'kind', " + f"'timestamp', 'lastUsage', 'numberOfHits', 'extraInfo'") + + @staticmethod + def check_context_response_body_containing_numberofhits_value(kwargs: list) -> str: + return f"Check that the numberOfHits in the response body is set to '{kwargs['expected_number_of_hists']}'" + + @staticmethod + def check_response_kind_set_to(kwargs: list) -> str: + return f"Check that the Kind of the @context is set to '{kwargs['kind']}'" + + @staticmethod + def check_cached_contexts(kwargs: list) -> str: + return f"Check that for each @context in the response body, they are of the type 'Cached'" + @staticmethod def check_response_body_containing_entity_element(kwargs: list) -> str: if 'filename' in kwargs and 'id' in kwargs and 'response' in kwargs: @@ -869,7 +1000,30 @@ class Checks: @staticmethod def check_updated_resource_set_to(kwargs: list) -> str: - return "Updated Entity set to ${entity}" + # return "Updated Entity set to ${entity}" + expected_parameters = ['updated_resource', 'response_body', 'ignored_keys'] + + if 'ignored_keys' not in kwargs: + kwargs['ignored_keys'] = '${None}' + + result = [x for x in kwargs if x not in expected_parameters] + response = "Check Updated Entity" + for key, value in kwargs.items(): + match key: + case 'updated_resource': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'response_body': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + case 'ignored_keys': + response = f"{response} and\n Query Parameter: '{key}' set to '{value}'" + # If an exact match is not confirmed, this last case will be used if provided + case 'checks': + pass + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response @staticmethod def check_updated_resources_set_to(kwargs: list) -> str: diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 5ed8685d2b31f4a45c6d094ca47a8b5f0298b9b4..0c6c7b391435acfe653b92279d36702b13e7cfb2 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -30,6 +30,11 @@ class GenerateRobotData: 'Consumption': 'Cons', 'Provision': 'Prov', 'ContextSource': 'CS', + 'jsonldContext': 'CTX', + 'Cons/ListContexts': 'Cons', + 'Cons/ServeContext': 'Cons', + 'Prov/AddContext': 'Prov', + 'Prov/DeleteContext': 'Prov', 'Discovery/RetrieveAvailableAttributeInformation': 'DISC', 'Discovery/RetrieveAvailableEntityTypeInformation': 'DISC', 'Discovery/RetrieveAvailableEntityTypes': 'DISC', diff --git a/doc/analysis/initial_setup.py b/doc/analysis/initial_setup.py index a23d90777071579155381b304e8d708e01f16c2c..3dd79db0500434ee8b582e9b9fd5ed06bd5c7429 100644 --- a/doc/analysis/initial_setup.py +++ b/doc/analysis/initial_setup.py @@ -31,6 +31,13 @@ class InitialSetup: 'Setup Initial Context Source Registration Subscription': InitialSetup.init_csr_sub(), 'Setup Initial Context Source Registration Subscriptions': InitialSetup.init_csr_subs(), 'Create Initial Context Source Registration and Mock Server': InitialSetup.init_csr_and_server(), + 'Create Initial set of @contexts': InitialSetup.create_set_contexts(), + 'Create Initial @context': InitialSetup.create_context(), + 'Create Initial cached @context': InitialSetup.created_cached_context(), + 'Create initial ImplicitlyCreated @context': InitialSetup.create_implictlycreated_context(), + 'Create Initial hosted @context': InitialSetup.create_hosted_context(), + 'Create Initial @context condition from an external server': InitialSetup.create_from_external_server(), + 'Delete core context and reload it': InitialSetup.delete_core_context() } self.total_files = -1 @@ -177,6 +184,55 @@ class InitialSetup: }''' return data + @staticmethod + def create_set_contexts(): + data = '''with { + the SUT containing a set of three Hosted @contexts and the default Cached Core Context. + }''' + return data + + @staticmethod + def create_context(): + data = '''with { + the SUT containing a Hosted @context and the default Cached Core Context. + }''' + return data + + @staticmethod + def created_cached_context(): + data = '''with { + the SUT containing a Cached @context added from a URL. + }''' + return data + + @staticmethod + def create_implictlycreated_context(): + data = '''with { + the SUT containing a ImplicitlyCreated @context created from a subscription query. + }''' + return data + + @staticmethod + def create_hosted_context(): + data = '''with { + the SUT containing a Hosted @context and the default Cached Core Context. + }''' + return data + + @staticmethod + def create_from_external_server(): + data = '''with { + the SUT containing a Cached @context created from a entity creation through downloading from external server. + }''' + return data + + @staticmethod + def delete_core_context(): + data = '''with { + the SUT containing a core context and it has been deleted with reload set to true. + }''' + return data + def get_property_values(self, root_folder: str, property_name: str) -> [str, str]: robot_files_without_setup = list() robot_files_with_setup = list() @@ -223,18 +279,15 @@ class InitialSetup: deleted_setup = [item for item in keys if item not in self.code] not_included_keys = [item for item in self.code if item not in keys] - print('Checking the Setup functions...') - if len(deleted_setup) != 0: - print(f" WARNING: Some of the Setup functions were deleted:\n{deleted_setup}") - else: - print(f" INFO: All current Setup functions are used in the Robot files") + if len(deleted_setup) != 0 or len(not_included_keys) != 0: + print('Checking the Setup functions...') + if len(deleted_setup) != 0: + print(f" WARNING: Some of the Setup functions were deleted or not implemented:\n{deleted_setup}") - if len(not_included_keys) != 0: - print(f" ERROR: Some Setup functions are not include in the Class:\n{not_included_keys}") - else: - print(f" INFO: All the current Setup functions used in Robot files are included in the Class") + if len(not_included_keys) != 0: + print(f" ERROR: Some Setup functions are not include in the Class:\n{not_included_keys}") - print() + print() def generate_dictionaries(self): folder = "/home/fla/Documents/workspace/bdd/ngsi-ld-test-suite/doc/files" diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index 6fe294d6d55defdd9866ec8829c2a155c6449bc2..07ad1326874da0b9291f43bd8bce3cd9b3dbc3e7 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -109,7 +109,7 @@ class ParseRobotFile: self.get_template_param_values(test_cases=string_test_cases) def get_template_content(self, string: str): - matches = re.findall(pattern=r'^(([a-zA-z0-9\-\/]+[ ]*)+)$', string=string, flags=re.MULTILINE) + matches = re.findall(pattern=r'^(([a-zA-z0-9\-\/@]+[ ]*)+)$', string=string, flags=re.MULTILINE) indexes = list() for match in matches: @@ -252,7 +252,8 @@ class ParseRobotFile: lines_starting_with_check = re.findall(r'^\s*Check.*', content, re.MULTILINE) if len(lines_starting_with_check) != 0: - # TODO: From the list of Checks, we need to discard all 'Check Response Status Code' except the last one. Should be resolve when clearly defined the Setup process of the Test Suite + # TODO: From the list of Checks, we need to discard all 'Check Response Status Code' except the last one. + # Should be resolve when clearly defined the Setup process of the Test Suite # check_string = 'Check Response Status Code' # lines_starting_with_check = [x.strip() for x in lines_starting_with_check] # new_list = [value for value in lines_starting_with_check if not value.startswith(check_string)] @@ -264,7 +265,11 @@ class ParseRobotFile: elif content.find('Wait for notification') != 0: # There is no Check, we need to check if there is a 'Wait for notification', # then we need to check the 'Should be Equal' sentences - pattern = r'(Wait for no notification)|(Wait for notification and validate it)|(Wait for notification)([ ]{4}(.*))?' + pattern = \ + (r'(Wait for no notification)|' + r'(Wait for notification and validate it)|' + r'(Wait for notification)([ ]{4}(.*))?') + param = re.findall(pattern=pattern, string=content, flags=re.MULTILINE) for i in range(0, len(param)): data = tuple(element for element in param[i] if element != '') @@ -317,7 +322,9 @@ class ParseRobotFile: def generate_then_content(self, content): # Need to check if it is a Notification data or a normal Response - aux = [x for x in content if x['checks'].find('Notification data') != -1 or x['checks'].find('After waiting') != -1 or x['checks'].find('Notification and validate') != -1] + aux = [x for x in content if x['checks'].find('Notification data') != -1 or + x['checks'].find('After waiting') != -1 or + x['checks'].find('Notification and validate') != -1] if len(aux) == 0: # The SUT sends a valid Response @@ -347,13 +354,15 @@ class ParseRobotFile: # exit(-1) # match = re.match(pattern=r"[\W\w]+'(\d+)'", string=content[0]) # try: - # checks = f"then {{\n the SUT will not send a CsourceNotification after {match.group(1)} seconds}}" + # checks = + # f"then {{\n the SUT will not send a CsourceNotification after {match.group(1)} seconds}}" # except Exception: # raise Exception(f"ERROR: unexpected timeout parameter: '{content[0]}'") # else: # print("Error, need to control the generation of then message") # exit(-1) - # checks = (f"then {{\n the client at '${{endpoint}}' receives a valid Notification, {content[0]}\n}}") + # checks = + # (f"then {{\n the client at '${{endpoint}}' receives a valid Notification, {content[0]}\n}}") else: raise Exception("ERROR, It is expected at least 1 Notification Check operation in the Test Case") @@ -384,8 +393,9 @@ class ParseRobotFile: position_params = checks.args[content[0]] if aux == 1: # We are in multiline classification of the Check, need to extract the parameter for the next lines - params, attributes = self.find_attributes_next_line(test_case=test_case, name=content[0], - position_params=position_params) + params, attributes = self.find_attributes_next_line(test_case=test_case, + name=content[0], + position_params=position_params) return content[0], params, attributes elif aux > 1: # We are in one line definition @@ -418,7 +428,15 @@ class ParseRobotFile: param_value = self.get_param_value_for_waiting(param_key=param_key, content=content) if param_value is not None: - result[param_key] = param_value + try: + # This is a parameter of the template, therefore we take the value of the param + result[param_key] = self.template_params_value[self.test_case_name][f'${{{param_value}}}'] + except KeyError: + # Check if it is a parameter of the Test Suite + try: + result[param_key] = self.variables[f'${{{param_value}}}'] + except KeyError: + result[param_key] = param_value return result @@ -437,7 +455,7 @@ class ParseRobotFile: pattern = f"\${{([\w\W]+)}}|([\w\W]+)" # elif length == 0 and len(content) > 1: - # # There is params but they are not written in the form key=value + # # There is params, but they are not written in the form key=value # found = content[1] # # pattern = f"\${{(\d+)}}" # pattern = f"\${{([\w\W]+)}}|([\w\W]+)" @@ -513,12 +531,18 @@ class ParseRobotFile: result = self.config_file.get_variable(aux) except KeyError: try: - aux = self.template_params_value[self.test_case_name] - result = aux[position] - - if result[:2] == "${": - result = self.get_param_value(result) + aux1 = self.template_params_value[self.test_case_name] + result = aux1[f'${{{aux}}}'] + + try: + if result[:2] == "${": + result = self.get_param_value(result) + except KeyError: + result = f'${{{aux}}}' except KeyError: - result = position + if '$' in position: + return position + else: + result = aux return result diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index 2810b9a5f8bca4c2e18879360e08a2c41d7bf242..1e93fb0bda271d458c46e106643d9ea1d0d4bda3 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -244,6 +244,24 @@ class Requests: 'Setup Initial Subscriptions': { 'positions': [], 'params': [] + }, + 'List @contexts': { + 'positions': [0, 1], + 'params': ['details', 'kind'] + + }, + 'Serve a @context': { + 'positions': [0, 1], + 'params': ['contextId', 'details'] + + }, + 'Add a new @context': { + 'positions': [0], + 'params': ['filename'] + }, + 'Delete a @context': { + 'positions': [0], + 'params': ['uri'] } } @@ -361,7 +379,15 @@ class Requests: 'Query Temporal Representation Of Entities Via Post': Requests.query_temporal_representation_of_entities_via_post, 'Setup Initial Subscriptions': - Requests.setup_initial_subscriptions + Requests.setup_initial_subscriptions, + 'List @contexts': + Requests.list_contexts, + 'Serve a @context': + Requests.serve_a_context, + 'Add a new @context': + Requests.add_a_new_context, + 'Delete a @context': + Requests.delete_a_context } self.variables = variables @@ -597,6 +623,42 @@ class Requests: else: raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") + @staticmethod + def list_contexts(kwargs) -> str: + expected_parameters = ['details', 'kind'] + + result = [x for x in kwargs if x not in expected_parameters] + response = "List @contexts:" + for key, value in kwargs.items(): + match key: + case 'details': + response = f"{response} and\n Query Parameter: details set to '{value}'" + case 'kind': + response = f"{response} and\n Query Parameter: kind set to '{value}'" + case _: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + return response + + @staticmethod + def serve_a_context(kwargs) -> str: + if 'details' not in kwargs: + kwargs['details'] = '${EMPTY}' + + response = f"Serve a @context with contextID '{kwargs['contextId']}' and details '{kwargs['details']}'" + + return response + + @staticmethod + def add_a_new_context(kwargs) -> str: + return f"Add a new @context based on the payload defined in the file {kwargs['filename']}" + + @staticmethod + def delete_a_context(kwargs) -> str: + return f"Delete a @context whose 'URI' set to '{kwargs['uri']}'" + + @staticmethod def create_context_source_registration(kwargs) -> str: if 'context_source_registration_payload' in kwargs: result = (f"Create Context Source Registration Request with Content-Type set to 'application/ld+json' " diff --git a/doc/files/ContextInformation/Consumption/019_01_01.json b/doc/files/ContextInformation/Consumption/019_01_01.json index 28bb8ddae445e4c8be5bef5d461ce7c17a94e1e2..f9955fb4cf42da35cf6518ef6d98261f44aec5a2 100644 --- a/doc/files/ContextInformation/Consumption/019_01_01.json +++ b/doc/files/ContextInformation/Consumption/019_01_01.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-minimal-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_01_02.json b/doc/files/ContextInformation/Consumption/019_01_02.json index c83004741877a906a73e09de909226b1dc03f0c0..f06d0445878b1c6268bc815086ae12e7b8c064f7 100644 --- a/doc/files/ContextInformation/Consumption/019_01_02.json +++ b/doc/files/ContextInformation/Consumption/019_01_02.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'expectation_filename' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'two-types-vehicle-offstreetparking-expectation.jsonld' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/ld+json'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_01_03.json b/doc/files/ContextInformation/Consumption/019_01_03.json index cff4ac0a5f2b4e5988f1398e19204f95ab563819..ab0e60a1d916125f58baebf49c83e2a01e29780a 100644 --- a/doc/files/ContextInformation/Consumption/019_01_03.json +++ b/doc/files/ContextInformation/Consumption/019_01_03.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-minimal-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_id_pattern set to 'urn:ngsi-ld:Building:.*' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_01_04.json b/doc/files/ContextInformation/Consumption/019_01_04.json index d748fa8b0f73b16fb7326d950d9bd2072f800045..f5ea11c9075396183f14e3a188156952e97e67f7 100644 --- a/doc/files/ContextInformation/Consumption/019_01_04.json +++ b/doc/files/ContextInformation/Consumption/019_01_04.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-attributes-query-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_01_05.json b/doc/files/ContextInformation/Consumption/019_01_05.json index d7c2dcd4b75f35777c72760ba56125eec4859175..d7a48e2f955773b49112836b927abc7bbd7bd4b3 100644 --- a/doc/files/ContextInformation/Consumption/019_01_05.json +++ b/doc/files/ContextInformation/Consumption/019_01_05.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-geoproperty-query-expectation.jsonld' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: georel set to 'equals' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_02_01.json b/doc/files/ContextInformation/Consumption/019_02_01.json index 1471f5f433cbc8d7d78d5a0a8e802bac8e685b89..d7ec3a92bdf21fa53f67845d72861c03100bf3f3 100644 --- a/doc/files/ContextInformation/Consumption/019_02_01.json +++ b/doc/files/ContextInformation/Consumption/019_02_01.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-minimal-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_ids set to '${first_entity_id}' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" diff --git a/doc/files/ContextInformation/Consumption/019_02_02.json b/doc/files/ContextInformation/Consumption/019_02_02.json index cfcf88af795cadb06dd15bcb0d845e4077fe69b9..8e26de62b8e98c160fbee80fd9638bbaace97a11 100644 --- a/doc/files/ContextInformation/Consumption/019_02_02.json +++ b/doc/files/ContextInformation/Consumption/019_02_02.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'expectation_filename' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response body containing a list containing entity elements with different types and\n Query Parameter: filename set to 'two-vehicles-expectation.jsonld' and\n Query Parameter: entities_representation_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: ignore_core_context_version set to 'True'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Vehicle' and\n Query Parameter: accept set to 'application/ld+json' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" diff --git a/doc/files/ContextInformation/Consumption/019_02_03.json b/doc/files/ContextInformation/Consumption/019_02_03.json index 2860bf8d8fe43c5e5ed925b60f36a23f859ed22a..192ca38a709274e3581e3f4f0df76ca25d826328 100644 --- a/doc/files/ContextInformation/Consumption/019_02_03.json +++ b/doc/files/ContextInformation/Consumption/019_02_03.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-minimal-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_id_pattern set to 'urn:ngsi-ld:Building:.*' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" diff --git a/doc/files/ContextInformation/Consumption/019_02_04.json b/doc/files/ContextInformation/Consumption/019_02_04.json index de2976e2f31ec3546e325d36f736761f59a69e89..88dc4256c2557b779d2f7ec96f151fd789465870 100644 --- a/doc/files/ContextInformation/Consumption/019_02_04.json +++ b/doc/files/ContextInformation/Consumption/019_02_04.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_retrieved' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'vehicle-simple-attributes-core-context-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_retrieved' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: attrs set to '${attributes_to_be_retrieved}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: accept set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" diff --git a/doc/files/ContextInformation/Consumption/019_02_05.json b/doc/files/ContextInformation/Consumption/019_02_05.json index db75a2738bdf9f25b1bd516c9171912595ba7ffd..fa79b3935b7e9eca0d409d1cc9f724e6e9d09c88 100644 --- a/doc/files/ContextInformation/Consumption/019_02_05.json +++ b/doc/files/ContextInformation/Consumption/019_02_05.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Check Response Body Content and\n Query Parameter: expectation_filename set to 'vehicle-parking-simple-expectation.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" diff --git a/doc/files/ContextInformation/Consumption/019_04.json b/doc/files/ContextInformation/Consumption/019_04.json index 78ed17f1cd9496608b483b549221647b763e0308..d8cfcf5e3c6cc2c6c7488636b57d2dec2c5de0f9 100644 --- a/doc/files/ContextInformation/Consumption/019_04.json +++ b/doc/files/ContextInformation/Consumption/019_04.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Body containing a list containing Entity Elements and\n Query Parameter: expectation_filename set to 'building-simple-attributes-simplified-expectation.json' and\n Query Parameter: entities_ids set to 'entities_ids_to_be_compared' and\n Query Parameter: ignore_core_context_version set to 'False'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'keyValues'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_05.json b/doc/files/ContextInformation/Consumption/019_05.json index 3a8d9be2cf3a8b73d8934350b417d3cbb0e4c549..04b800af8f714a507eba955958d505dc05d7f1c6 100644 --- a/doc/files/ContextInformation/Consumption/019_05.json +++ b/doc/files/ContextInformation/Consumption/019_05.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Check Response Body Content and\n Query Parameter: expectation_filename set to 'two-buildings-location-attribute-normalized.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Consumption/019_07.json b/doc/files/ContextInformation/Consumption/019_07.json index 8b688e4978303c9515bdd828f850e1c60be9922d..78c77725d5aaeef706eecc4bb76c18a675ca8cc7 100644 --- a/doc/files/ContextInformation/Consumption/019_07.json +++ b/doc/files/ContextInformation/Consumption/019_07.json @@ -22,9 +22,9 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_07_01", "doc": "If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.", "tags": [ - "e-query", "5_7_2", - "6_3_13" + "6_3_13", + "e-query" ], "setup": null, "teardown": null, @@ -39,9 +39,9 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_07_02", "doc": "If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.", "tags": [ - "e-query", "5_7_2", - "6_3_13" + "6_3_13", + "e-query" ], "setup": null, "teardown": null, diff --git a/doc/files/ContextInformation/Provision/008_01.json b/doc/files/ContextInformation/Provision/008_01.json index ca58c05cdbca6c335961a9af3ac551d55c763f1f..ad50d4d3ef06057b247790a8dacaf5d5ce84826e 100644 --- a/doc/files/ContextInformation/Provision/008_01.json +++ b/doc/files/ContextInformation/Provision/008_01.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-create-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", "http_verb": "POST", "endpoint": "temporal/entities" diff --git a/doc/files/ContextInformation/Provision/010_01.json b/doc/files/ContextInformation/Provision/010_01.json index ec4d27d20f5a6e1a80662d2bea732422398082d9..73b53a7b8d0b563b13baadac04f6784e721a06b7 100644 --- a/doc/files/ContextInformation/Provision/010_01.json +++ b/doc/files/ContextInformation/Provision/010_01.json @@ -27,7 +27,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": "Append Attributes Without Params", - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-attribute-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs" @@ -43,7 +43,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": "Append Attributes Without Params", - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs" diff --git a/doc/files/ContextInformation/Provision/010_04.json b/doc/files/ContextInformation/Provision/010_04.json index 310e64c2df513f4db25483aa739678e952d56664..0a03a635c797a85cb414b3d5ab689e239c5a4799 100644 --- a/doc/files/ContextInformation/Provision/010_04.json +++ b/doc/files/ContextInformation/Provision/010_04.json @@ -27,7 +27,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": "Append Attributes With Params", - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n ${expectation_filename} with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_response_body' and\n Query Parameter: response_body set to '' and\n Query Parameter: additional_ignored_path set to 'root\\\\['notUpdated'\\\\]\\\\[0\\\\]\\\\['reason'\\\\]' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs?options=${options}'\n method set to 'POST'\n Append entity attributes with parameters: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-attribute-to-add-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: options set to 'noOverwrite'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs?options=${options}" @@ -43,7 +43,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": "Append Attributes With Params", - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n ${expectation_filename} with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_response_body' and\n Query Parameter: response_body set to '' and\n Query Parameter: additional_ignored_path set to 'root\\\\['notUpdated'\\\\]\\\\[0\\\\]\\\\['reason'\\\\]' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs?options=${options}'\n method set to 'POST'\n Append entity attributes with parameters: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: options set to 'noOverwrite'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs?options=${options}" diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json index f1503514af5d4885384ce385be4ee9a2e3bf80b8..5bc0a443ee6177d42317b609dcf5229ad0cb1dda 100644 --- a/doc/files/ContextInformation/Provision/010_06.json +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -30,7 +30,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": "Append Attributes Without Params", - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs" diff --git a/doc/files/ContextInformation/Provision/010_07.json b/doc/files/ContextInformation/Provision/010_07.json index 340660ee93d2252b18632273cc3949b4d9f58e67..30734107c691b04970d2619c3dabec7732c8785b 100644 --- a/doc/files/ContextInformation/Provision/010_07.json +++ b/doc/files/ContextInformation/Provision/010_07.json @@ -29,7 +29,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Append Entity Attributes with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Append Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "" @@ -47,7 +47,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n Append Entity Attributes With Parameters with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes With Parameters with Response Status Code set to 204 and\n Append Entity Attributes With Parameters with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "" diff --git a/doc/files/ContextInformation/Provision/011_01.json b/doc/files/ContextInformation/Provision/011_01.json index 4fcaa02264060e236897ca761e20c09683f4f3e1..45a0184292463763abc2001516f7d189257d47b9 100644 --- a/doc/files/ContextInformation/Provision/011_01.json +++ b/doc/files/ContextInformation/Provision/011_01.json @@ -27,7 +27,7 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" @@ -43,7 +43,7 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-02-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" @@ -59,7 +59,7 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-03-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" diff --git a/doc/files/ContextInformation/Provision/011_05.json b/doc/files/ContextInformation/Provision/011_05.json index 9052f782c4e19a1913d774d672eab5384237438b..21e338f7e7a8c680ffaf441b65ed7df2236e09a4 100644 --- a/doc/files/ContextInformation/Provision/011_05.json +++ b/doc/files/ContextInformation/Provision/011_05.json @@ -29,7 +29,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "" @@ -47,7 +47,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 207 and\n Update Entity Attributes with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 207 and\n Update Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "" diff --git a/doc/files/ContextInformation/Provision/012_01.json b/doc/files/ContextInformation/Provision/012_01.json index 2625f86c26f701837e7134efb3a18c7554fd42cd..d3ad1252707a9b3c127851b0e516924f009247ec 100644 --- a/doc/files/ContextInformation/Provision/012_01.json +++ b/doc/files/ContextInformation/Provision/012_01.json @@ -27,7 +27,7 @@ "setup": "Initiate Test Case", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'isParked' and\n Query Parameter: fragment_filename set to 'vehicle-isparked-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" @@ -43,7 +43,7 @@ "setup": "Initiate Test Case", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'speed' and\n Query Parameter: fragment_filename set to 'vehicle-speed-equal-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" diff --git a/doc/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json index a097037681b0da4e03b891679b14a5e7f69a82ce..24136c63490d8d892ffe69ecbfc90adabb1d9ae6 100644 --- a/doc/files/ContextInformation/Provision/012_04.json +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -30,7 +30,7 @@ "setup": "Initiate Test Case", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'street' and\n Query Parameter: fragment_filename set to 'building-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" diff --git a/doc/files/ContextInformation/Provision/013_01.json b/doc/files/ContextInformation/Provision/013_01.json index 5234a8e86731865b2eadad26a2fd5e1f82d2596d..8567f7a512af6a5c77b40eab97ee38095d41b189 100644 --- a/doc/files/ContextInformation/Provision/013_01.json +++ b/doc/files/ContextInformation/Provision/013_01.json @@ -26,7 +26,7 @@ "setup": null, "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" @@ -42,7 +42,7 @@ "setup": null, "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" @@ -58,7 +58,7 @@ "setup": null, "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" diff --git a/doc/files/ContextInformation/Provision/013_04.json b/doc/files/ContextInformation/Provision/013_04.json index 48a71b19d064174215ad9d9546dacde85517a328..e2dc930b3e29b2b31677c8efcc2c9a5886e46dea 100644 --- a/doc/files/ContextInformation/Provision/013_04.json +++ b/doc/files/ContextInformation/Provision/013_04.json @@ -29,7 +29,7 @@ "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Delete Entity Attributes with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Delete Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json'\n}", "http_verb": "GET", "endpoint": "" diff --git a/doc/files/ContextInformation/Provision/014_01.json b/doc/files/ContextInformation/Provision/014_01.json index 681f9fa436e9af3c6882b79f3a9eeb6e724bc5b1..993b991e66c2b69fa7fcb7886fbf56fab3386165 100644 --- a/doc/files/ContextInformation/Provision/014_01.json +++ b/doc/files/ContextInformation/Provision/014_01.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Append Attribute To Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs'\n method set to 'POST'\n Append Attribute to Temporal Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: fragment_filename set to 'vehicle-temporal-representation-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "temporal/entities/{temporal_entity_id}/attrs" diff --git a/doc/files/ContextInformation/Provision/015_01.json b/doc/files/ContextInformation/Provision/015_01.json index 131d2e6716286268d831eda49eaeb95f5736fea2..bb20e2ae5e6f8544a005b3adae983224c85ddffd 100644 --- a/doc/files/ContextInformation/Provision/015_01.json +++ b/doc/files/ContextInformation/Provision/015_01.json @@ -27,7 +27,7 @@ "setup": "Initialize Setup", "teardown": "Delete Temporal Entity", "template": "Delete Attribute From A Temporal Entity", - "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" @@ -43,7 +43,7 @@ "setup": "Initialize Setup", "teardown": "Delete Temporal Entity", "template": "Delete Attribute From A Temporal Entity", - "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" @@ -59,7 +59,7 @@ "setup": "Initialize Setup", "teardown": "Delete Temporal Entity", "template": "Delete Attribute From A Temporal Entity", - "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Attribute From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Attribute From Temporal Entity: and\n Query Parameter: entityId set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'fuelLevel' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: datasetId set to '${datasetid}' and\n Query Parameter: deleteAll set to '${deleteall}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "temporal/entities/{entityId}/attrs/{attributeId}?${params_as_string}" diff --git a/doc/files/ContextInformation/Provision/016_01.json b/doc/files/ContextInformation/Provision/016_01.json index b652c642711070de788f437d9a5ec052877ee2a9..891bc2ccc908f58a97eb9b9e86cd90367bb10bc6 100644 --- a/doc/files/ContextInformation/Provision/016_01.json +++ b/doc/files/ContextInformation/Provision/016_01.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Modify Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Create or Update Temporal Representation of Entity Selecting Content Type: and\n Query Parameter: temporal_entity_representation_id set to '${temporal_entity_representation_id}' and\n Query Parameter: filename set to 'vehicle-temporal-representation-sample.jsonld' and\n Query Parameter: content_type set to 'application/ld+json' and\n Query Parameter: accept set to '${EMPTY}'\n}", "http_verb": "POST", "endpoint": "temporal/entities" diff --git a/doc/files/ContextInformation/Provision/017_01.json b/doc/files/ContextInformation/Provision/017_01.json index 9f8a83372570fecc8610a10f9eab94df474c39a1..ebdbd319f8dd007667a8ddc014d406d4a17a8081 100644 --- a/doc/files/ContextInformation/Provision/017_01.json +++ b/doc/files/ContextInformation/Provision/017_01.json @@ -25,7 +25,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Or Update Temporal Representation Of Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Attribute Instance From Temporal Entity with Response Status Code set to 204 and\n Retrieve Temporal Representation Of Entity with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'temporal_entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_id}/attrs/speed/{instanceId}'\n method set to 'DELETE'\n Delete Attribute Instance from Temporal Entity: and\n Query Parameter: temporal_entity_id set to '${temporal_entity_representation_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: instanceId set to '${instanceId}' and\n Query Parameter: content_type set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "temporal/entities/{temporal_entity_id}/attrs/speed/{instanceId}" diff --git a/doc/files/ContextInformation/Subscription/029_06.json b/doc/files/ContextInformation/Subscription/029_06.json index af9661f423b630586c3e19bb378c7589a2818563..2085014f34826f2f7fb814c30e409794610d6505 100644 --- a/doc/files/ContextInformation/Subscription/029_06.json +++ b/doc/files/ContextInformation/Subscription/029_06.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Subscription with Response Status Code set to 204 and\n Retrieve Subscription with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'subscription' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'\n}", "http_verb": "PATCH", "endpoint": "subscriptions/{subscription_id}" diff --git a/doc/files/ContextSource/RegistrationSubscription/038_01.json b/doc/files/ContextSource/RegistrationSubscription/038_01.json index 5577c37f9ae0c56747fa12c1ae0de74d21f1294d..803b05b02586e857b8f20df65134c47a8a896908 100644 --- a/doc/files/ContextSource/RegistrationSubscription/038_01.json +++ b/doc/files/ContextSource/RegistrationSubscription/038_01.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastNotification' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastFailure' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'lastSuccess' and\n Retrieve Context Source Registration Subscription with The dictionary `${response1.json()}' might contain the key 'timesSent'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration Subscription with Response Status Code set to 201 and\n Create Context Source Registration Subscription with Response Header: Location containing $${subscription_id} and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys and\n Retrieve Context Source Registration Subscription with The Response Body `${response1.json()}' might contain the key 'lastNotification' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response1.json()}' might contain the key 'lastNotification' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response1.json()}' might contain the key 'lastNotification' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response1.json()}' might contain the key 'timesSent' in the NotificationParams\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'POST'\n Create Context Source Registration Subscription with filename set to '${subscription_payload}', accept set to '${EMPTY}', and content-type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "csourceSubscriptions" diff --git a/doc/files/ContextSource/RegistrationSubscription/039_01.json b/doc/files/ContextSource/RegistrationSubscription/039_01.json index c6a334e7fa42b462df762cf79eedf0261e2d5dc2..dd62ff2cae1eb512f4832d16aa677d1b624c8437 100644 --- a/doc/files/ContextSource/RegistrationSubscription/039_01.json +++ b/doc/files/ContextSource/RegistrationSubscription/039_01.json @@ -26,7 +26,7 @@ "setup": "Setup Initial Context Source Registration Subscriptions", "teardown": "Delete Initial Context Source Registration Subscriptions", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 204 and\n Update Context Source Registration Subscription with Response does not contain a body and\n Update Context Source Registration Subscription with Response reason set to 'No Content' and\n Retrieve Context Source Registration Subscription with Updated Entity set to ${entity}\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Context Source Registration Subscription with Response Status Code set to 204 and\n Update Context Source Registration Subscription with Response does not contain a body and\n Update Context Source Registration Subscription with Response reason set to 'No Content' and\n Retrieve Context Source Registration Subscription with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'subscription' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", "http_verb": "PATCH", "endpoint": "csourceSubscriptions/{subscription_id}" diff --git a/doc/files/ContextSource/RegistrationSubscription/040_01.json b/doc/files/ContextSource/RegistrationSubscription/040_01.json index 43c2dba440f090ec986a6ee50ed237e025c9eaf0..d41021bccb3916e5d6cc39ad14362474cc1842ab 100644 --- a/doc/files/ContextSource/RegistrationSubscription/040_01.json +++ b/doc/files/ContextSource/RegistrationSubscription/040_01.json @@ -26,7 +26,7 @@ "setup": "Setup Initial Context Source Registration Subscription", "teardown": "Delete Created Context Source Registration Subscription", "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration Subscription with Response Status Code set to 200 and\n Retrieve Context Source Registration Subscription with Response reason set to 'OK' and\n Retrieve Context Source Registration Subscription with The response headers Link is set to 'expected_link_header=${expected link header}' and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'expectation_payload' and\n Query Parameter: 'response_body' set to 'response.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes' list of keys and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastNotification' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastFailure' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'lastSuccess' and\n Retrieve Context Source Registration Subscription with The dictionary `${response.json()}' might contain the key 'timesSent'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Context Source Registration Subscription with Response Status Code set to 200 and\n Retrieve Context Source Registration Subscription with Response reason set to 'OK' and\n Retrieve Context Source Registration Subscription with The response headers Link is set to 'expected_link_header=${expected link header}' and\n Retrieve Context Source Registration Subscription with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'expectation_payload' and\n Query Parameter: 'response_body' set to 'response.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes' list of keys and\n Retrieve Context Source Registration Subscription with The Response Body `${response.json()}' might contain the key 'lastNotification' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response.json()}' might contain the key 'lastFailure' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response.json()}' might contain the key 'lastSuccess' in the NotificationParams and\n Retrieve Context Source Registration Subscription with The Response Body `${response.json()}' might contain the key 'timesSent' in the NotificationParams\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'GET'\n Retrieve Context Source Registration Subscription with data: and\n Query Parameter: subscription id set to '${subscription_id}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "csourceSubscriptions/{subscription_id}" diff --git a/doc/files/ContextSource/RegistrationSubscription/047_16.json b/doc/files/ContextSource/RegistrationSubscription/047_16.json index 2c6919213e59801bb0b990e6e9166731a5ab3149..cec4c29511daa0381d9c93d1185a04189c6220cb 100644 --- a/doc/files/ContextSource/RegistrationSubscription/047_16.json +++ b/doc/files/ContextSource/RegistrationSubscription/047_16.json @@ -27,7 +27,7 @@ "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", - "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to '${first_context_source_registration_id}' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", "http_verb": "PATCH", "endpoint": "csourceSubscriptions/{subscription_id}" @@ -43,7 +43,7 @@ "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", - "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to '${second_context_source_registration_id}' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", "http_verb": "PATCH", "endpoint": "csourceSubscriptions/{subscription_id}" @@ -59,13 +59,15 @@ "setup": "Create Initial Context Source Registrations And Context Source Registration Subscription", "teardown": "Delete Created Context Source Registrations And Context Source Registration Subscription", "template": "Receive cSourceNotification For Newly Matching Context Source Registrations", - "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to 'notification_csr_ids' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", + "then": "then {\n the client at '${endpoint}' receives a valid Notification containing:\n Notification received Waiting for Notification and validate it and\n Query Parameter: expected_subscription_id set to 'subscription_id' and\n Query Parameter: expected_context_source_registration_ids set to '${first_context_source_registration_id}' and\n Query Parameter: expected_trigger_reason set to 'newlyMatching' and\n Query Parameter: expected_notification_data_entities set to '${EMPTY}' and\n Query Parameter: timeout set to '5'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions/{subscription_id}'\n method set to 'PATCH'\n Update Context Source Registration Subscription with subscription id set to '${subscription_id}' and subscription update fragment set to '${subscription_update_fragment}'\n}", "http_verb": "PATCH", "endpoint": "csourceSubscriptions/{subscription_id}" } ], - "permutations": [], + "permutations": [ + "then" + ], "robotpath": "ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour", "robotfile": "047_16" } \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_01.json b/doc/files/jsonldContext/Consumption/052_01.json new file mode 100644 index 0000000000000000000000000000000000000000..96b10fb0ce982f6176d55f2b7b8c22b31d52dd95 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_01.json @@ -0,0 +1,160 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_01", + "test_objective": "Check that you can list all the @context available in the broker with no previous add @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "List @contexts with no previous created @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "052_01_01 List @contexts with neither details or kind and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_02 List @contexts with no details and kind equal to hosted and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_03 List @contexts with no details and kind equal to cached and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_04 List @contexts with no details and kind equal to implicitlycreated and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_05 List @contexts with details equal to false and no kind and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_05", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_06 List @contexts with details equal to false and kind equal to hosted and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_06", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_07 List @contexts with details equal to false and kind equal to cached and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_07", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_01_08 List @contexts with details equal to false and kind equal to implicitlycreated and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_01_08", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_01" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_02.json b/doc/files/jsonldContext/Consumption/052_02.json new file mode 100644 index 0000000000000000000000000000000000000000..988343776422e3de9dcdfd51b7a6861a794c1f64 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_02.json @@ -0,0 +1,162 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_02", + "test_objective": "Check that you can list all the @context available in the broker with one add @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context", + "List @contexts with one previous created @context", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "052_02_01 List @contexts with neither details or kind and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '2' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_02 List @contexts with no details and kind equal to hosted and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_03 List @contexts with no details and kind equal to cached and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Cached'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_04 List @contexts with no details and kind equal to implicitlycreated and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_05 List @contexts with details equal to false and no kind and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_05", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '2' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_06 List @contexts with details equal to false and kind equal to hosted and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_06", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_07 List @contexts with details equal to false and kind equal to cached abd with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_07", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Cached'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_02_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously one add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_02_08", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "List @contexts with one previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_02" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_03.json b/doc/files/jsonldContext/Consumption/052_03.json new file mode 100644 index 0000000000000000000000000000000000000000..f0b728af766927385442bb40788c72010ab1ec20 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_03.json @@ -0,0 +1,162 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_03", + "test_objective": "Check that you can list all the @context available in the broker with several add @contexts", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial set of @contexts", + "List @contexts with several previous created @context", + "Delete Initial @contexts" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a set of three Hosted @contexts and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "052_03_01 List @contexts with neither details or kind and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '4' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_02 List @contexts with no details and kind equal to hosted and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '3' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_03 List @contexts with no details and kind equal to cached and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Cached'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_04 List @contexts with no details and kind equal to implicitlycreated and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_05 List @contexts with details equal to false and no kind and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_05", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '4' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_06 List @contexts with details equal to false and kind equal to hosted and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_06", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '3' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_07 List @contexts with details equal to false and kind equal to cached abd with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_07", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'Cached'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_03_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously several add @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_03_08", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'uri_list' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_03" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_04.json b/doc/files/jsonldContext/Consumption/052_04.json new file mode 100644 index 0000000000000000000000000000000000000000..140080c3280ea55a5593e12301ec9149d892372c --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_04.json @@ -0,0 +1,108 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_04", + "test_objective": "Check that you get an error when try to list @context with wrong details or kind", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "List @contexts with no previous created @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "052_04_01 List @contexts with no details and kind set to other and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_04_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 400 and\n List @contexts with Response reason set to 'Bad Request' and\n List @contexts with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'other'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_04_02 List @contexts with details set to other and no kind and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_04_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 400 and\n List @contexts with Response reason set to 'Bad Request' and\n List @contexts with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'other' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_04_03 List @contexts with details set to other and kind set to other and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_04_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 400 and\n List @contexts with Response reason set to 'Bad Request' and\n List @contexts with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'other' and\n Query Parameter: kind set to 'other'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_04_04 List @contexts with details set to true and kind set to other and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_04_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 400 and\n List @contexts with Response reason set to 'Bad Request' and\n List @contexts with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to 'other'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_04_05 List @contexts with details set to other and kind set to Hosted and not previously created @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_04_05", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 400 and\n List @contexts with Response reason set to 'Bad Request' and\n List @contexts with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'other' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_04" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_05.json b/doc/files/jsonldContext/Consumption/052_05.json new file mode 100644 index 0000000000000000000000000000000000000000..e07d23dd1d986c00129e6cac066973f39a8c6ff1 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_05.json @@ -0,0 +1,94 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_05", + "test_objective": "Check that you can list all the @context available in the broker with several add @contexts with details equal to true", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial set of @contexts", + "List @contexts with several previous created @context", + "Delete Initial @contexts" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a set of three Hosted @contexts and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "052_05_01 List @contexts with details set to true and no kind and with previously several add @contexts", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_05_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Response Body containing a Context element containing JSONObject with details of the contexts:\n * the expected length of contexts set to '4'\n * the list of contexts URI set to 'list_contexts=${uris}'\n * response body to be checked set to 'response=${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_05_02 List @contexts with details set to true and kind set to hosted and with previously several add @contexts", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_05_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Response Body containing a Context element containing JSONObject with details of the contexts:\n * the expected length of contexts set to '3'\n * the list of contexts URI set to 'list_contexts=${uris}'\n * response body to be checked set to 'response=${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_05_03 List @contexts with details set to true and kind set to cached abd with previously several add @contexts", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_05_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Response Body containing a Context element containing JSONObject with details of the contexts:\n * the expected length of contexts set to '1'\n * the list of contexts URI set to 'list_contexts=${uris}'\n * response body to be checked set to 'response=${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_05_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create Initial set of @contexts", + "teardown": "Delete Initial @contexts", + "template": "List @contexts with several previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Response Body containing a Context element containing JSONObject with details of the contexts:\n * the expected length of contexts set to '0'\n * the list of contexts URI set to 'list_contexts=${uris}'\n * response body to be checked set to 'response=${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_05" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/052_06.json b/doc/files/jsonldContext/Consumption/052_06.json new file mode 100644 index 0000000000000000000000000000000000000000..504354d527e4783a71f1714fbfdc975134f11cff --- /dev/null +++ b/doc/files/jsonldContext/Consumption/052_06.json @@ -0,0 +1,162 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/052_06", + "test_objective": "Check that you can list all the @context available in the broker with no previous add @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.3", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.3" + ], + "pics_selection": "", + "keywords": [ + "List @contexts with no previous created @context", + "Create initial ImplicitlyCreated @context", + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a ImplicitlyCreated @context created from a subscription query.\n }", + "test_cases": [ + { + "name": "052_06_01 List @contexts with neither details or kind and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_01", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '4' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_02 List @contexts with no details and kind set to hosted and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_02", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_03 List @contexts with no details and kind set to cached and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_03", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '3' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_04 List @contexts with no details and kind set to implicitlycreated and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_04", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to '${EMPTY}' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_05 List @contexts with details set to false and no kind and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_05", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '4' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_06 List @contexts with details set to false and kind equal to hosted and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_06", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '0' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Hosted'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_07 List @contexts with details set to false and kind equal to cached and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_07", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '3' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'Cached'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + }, + { + "name": "052_06_08 List @contexts with details set to false and kind equal to implicitlycreated and a created ImplicitlyCreated @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/052_06_08", + "doc": "Check that you can list @contexts", + "tags": [ + "5_13_3", + "ctx-list", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": "List @contexts with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n List @contexts with Response Status Code set to 200 and\n List @contexts with Response reason set to 'OK' and\n List @contexts with Check Context Response Body Containing a list of identifiers and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: expected_length set to '1' and\n Query Parameter: list_contexts set to 'list_contexts'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'false' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ListContexts", + "robotfile": "052_06" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_01.json b/doc/files/jsonldContext/Consumption/053_01.json new file mode 100644 index 0000000000000000000000000000000000000000..570ce3e5043641638418910feff888ed8ef61e36 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_01.json @@ -0,0 +1,59 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_01", + "test_objective": "Check that you can serve a previous created @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context", + "Serve a @context with details", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "053_01_01 Serve a @context without details", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_01_01", + "doc": "Check that you can serve a @context with details equal to empty or false", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve a @context with details", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Response reason set to 'OK' and\n Serve a @context with Response Header: Content-Type set to application/json and\n Serve a @context with Check the Body of the response should contain the @context `@context-minimal-valid.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details '${EMPTY}'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "053_01_02 Serve a @context with details equal to false", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_01_02", + "doc": "Check that you can serve a @context with details equal to empty or false", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve a @context with details", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Response reason set to 'OK' and\n Serve a @context with Response Header: Content-Type set to application/json and\n Serve a @context with Check the Body of the response should contain the @context `@context-minimal-valid.json'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'false'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_01" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_02.json b/doc/files/jsonldContext/Consumption/053_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a26a7797937b41303131a0c6a9c29f82a2f8b9d0 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_02.json @@ -0,0 +1,40 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_02", + "test_objective": "Check that you can serve a previous created @context with details equal to True", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context", + "Serve a @context with details equal to true", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "053_02_01 Serve a @context with details set to True", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_02_01", + "doc": "Check that you can serve a @context with details", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve a @context with details equal to true", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Response reason set to 'OK' and\n Serve a @context with Response Header: Content-Type set to application/json and\n Serve a @context with Check the Body of the response should contain a @context with 'URL' key not Empty and 'string' type, with 'localId' key not Empty and 'string' type, with 'kind' key not Empty, 'string' type, and value set to 'Hosted', and 'timestamp and 'DateTime' format and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'lastUsage' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'numberOfHits' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'extraInfo' and\n Serve a @context with Check that the only allowed keys in the response body of a @context are 'URL', 'localId', 'kind', 'timestamp', 'lastUsage', 'numberOfHits', 'extraInfo'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_02" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_03.json b/doc/files/jsonldContext/Consumption/053_03.json new file mode 100644 index 0000000000000000000000000000000000000000..f5627e047be1726eb3b041a0bfd37326c39687ab --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_03.json @@ -0,0 +1,77 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_03", + "test_objective": "Check that you get an error when try to serve a @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Serve @context with no previous created @context", + "Create Initial @context", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "053_03_01 Serve a @contexts with a wrong id and correct details", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_03_01", + "doc": "Check that an error is returned when we request for a @context that does not exist", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve @context with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 404 and\n Serve a @context with Response reason set to 'Not Found' and\n Serve a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID 'wrong_id_context' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "053_03_02 Serve a @contexts with a valid id and incorrect details", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_03_02", + "doc": "Check that an error is returned when we request for a @context that does not exist", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve @context with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 400 and\n Serve a @context with Response reason set to 'Bad Request' and\n Serve a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'other'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "053_03_03 Serve a Cached @contexts with details set to false", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_03_03", + "doc": "Check that an error is returned when we request for a @context that does not exist", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Serve @context with no previous created @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 422 and\n Serve a @context with Response reason set to 'Unprocessable Content' and\n Serve a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld' and details 'false'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_03" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_04.json b/doc/files/jsonldContext/Consumption/053_04.json new file mode 100644 index 0000000000000000000000000000000000000000..97da09b1bc81f0ccc8ea24e8748a98bff2454f6b --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_04.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_04", + "test_objective": "Check that you can get an increase numberOfHits after creation of a Hosted @context and using it", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context condition from an external server", + "Delete Initial @context condition from an external server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Cached @context created from a entity creation through downloading from external server.\n }", + "test_cases": [ + { + "name": "053_04_01 Check that the numberOfHits is increased after using a Hosted context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_04_01", + "doc": "Check that the numberOfHits is increased after using a Hosted context", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context condition from an external server", + "teardown": "Delete Initial @context condition from an external server", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Check that the numberOfHits in the response body is set to '2'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_04" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_05.json b/doc/files/jsonldContext/Consumption/053_05.json new file mode 100644 index 0000000000000000000000000000000000000000..dafa52eec5c47359a25185208581e16c327eb990 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_05.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_05", + "test_objective": "Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context condition from an external server", + "Delete Initial @context condition from an external server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Cached @context created from a entity creation through downloading from external server.\n }", + "test_cases": [ + { + "name": "053_05_01 Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_05_01", + "doc": "Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context condition from an external server", + "teardown": "Delete Initial @context condition from an external server", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Response reason set to 'OK' and\n Serve a @context with Response Header: Content-Type set to application/json and\n Serve a @context with Check the Body of the response should contain a @context with 'URL' key not Empty and 'string' type, with 'localId' key not Empty and 'string' type, with 'kind' key not Empty, 'string' type, and value set to 'Cached', and 'timestamp and 'DateTime' format and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'lastUsage' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'numberOfHits' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'extraInfo' and\n Serve a @context with Check that the only allowed keys in the response body of a @context are 'URL', 'localId', 'kind', 'timestamp', 'lastUsage', 'numberOfHits', 'extraInfo'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_05" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_06.json b/doc/files/jsonldContext/Consumption/053_06.json new file mode 100644 index 0000000000000000000000000000000000000000..637c033ef5bb93075c8c6c3e4b9bdd40881e162b --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_06.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_06", + "test_objective": "Check that the numberOfHits is increased after using a Cached context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context condition from an external server", + "Delete Initial @context condition from an external server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Cached @context created from a entity creation through downloading from external server.\n }", + "test_cases": [ + { + "name": "053_06_01 Check that the numberOfHits is increased after using a Cached context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_06_01", + "doc": "Check that the numberOfHits is increased after using a Cached context", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context condition from an external server", + "teardown": "Delete Initial @context condition from an external server", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Check that the numberOfHits in the response body is set to '2'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${uri}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_06" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_07.json b/doc/files/jsonldContext/Consumption/053_07.json new file mode 100644 index 0000000000000000000000000000000000000000..5100058c8a69fc7469a8695b3a36d08d0dec93a4 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_07.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_07", + "test_objective": "Check that we can serve a ImplicitlyCreated @context with details set to true", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create initial ImplicitlyCreated @context", + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a ImplicitlyCreated @context created from a subscription query.\n }", + "test_cases": [ + { + "name": "053_07_01 Check that we can serve a ImplicitlyCreated @context with details set to true", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_07_01", + "doc": "Check that we can serve a ImplicitlyCreated @context with details set to true", + "tags": [ + "5_13_4", + "since_v1.5.1", + "sub-create" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Response reason set to 'OK' and\n Serve a @context with Response Header: Content-Type set to application/json and\n Serve a @context with Check the Body of the response should contain a @context with 'URL' key not Empty and 'string' type, with 'localId' key not Empty and 'string' type, with 'kind' key not Empty, 'string' type, and value set to 'ImplicitlyCreated', and 'timestamp and 'DateTime' format and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'lastUsage' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'numberOfHits' and\n Serve a @context with The Response Body `${response.json()}' might contain the key 'extraInfo' and\n Serve a @context with Check that the only allowed keys in the response body of a @context are 'URL', 'localId', 'kind', 'timestamp', 'lastUsage', 'numberOfHits', 'extraInfo'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${implicit_id}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_07" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Consumption/053_08.json b/doc/files/jsonldContext/Consumption/053_08.json new file mode 100644 index 0000000000000000000000000000000000000000..1b9fa6de01d98d180dc5964a5661435802d71244 --- /dev/null +++ b/doc/files/jsonldContext/Consumption/053_08.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Cons/053_08", + "test_objective": "Check that the numberOfHits is increased after using a ImplicitlyCreated context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.4", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.4" + ], + "pics_selection": "", + "keywords": [ + "Create initial ImplicitlyCreated @context", + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a ImplicitlyCreated @context created from a subscription query.\n }", + "test_cases": [ + { + "name": "053_08_01 Check that the numberOfHits is increased after using a ImplicitlyCreated context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Cons/053_08_01", + "doc": "Check that the numberOfHits is increased after using a ImplicitlyCreated context", + "tags": [ + "5_13_4", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Serve a @context with Response Status Code set to 200 and\n Serve a @context with Check that the numberOfHits in the response body is set to '2'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID '${implicit_id}' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Consumption/ServeContext", + "robotfile": "053_08" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/050_01.json b/doc/files/jsonldContext/Provision/050_01.json new file mode 100644 index 0000000000000000000000000000000000000000..81e85d1bd66816a71724ad82b77664d497fd4e33 --- /dev/null +++ b/doc/files/jsonldContext/Provision/050_01.json @@ -0,0 +1,58 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/050_01", + "test_objective": "Check that you can add a hosted @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.2", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.2" + ], + "pics_selection": "", + "keywords": [ + "Add a valid @context", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "050_01_01 Add a valid hosted @context from key=value", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_01_01", + "doc": "Check that you can add a @context", + "tags": [ + "5_13_2", + "ctx-add", + "since_v1.5.1" + ], + "setup": null, + "teardown": "Delete Initial @context", + "template": "Add a valid @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Add a new @context with Response Status Code set to 201 and\n Add a new @context with Response does not contain a body and\n Add a new @context with Response reason set to 'Created' and\n Serve a @context with Check that the Kind of the @context is set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts'\n method set to 'POST'\n Add a new @context based on the payload defined in the file @context-minimal-valid.json\n}", + "http_verb": "POST", + "endpoint": "jsonldContexts" + }, + { + "name": "050_01_02 Add a valid cached @context from URI", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_01_02", + "doc": "Check that you can add a @context", + "tags": [ + "5_13_2", + "ctx-add", + "since_v1.5.1" + ], + "setup": null, + "teardown": "Delete Initial @context", + "template": "Add a valid @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Add a new @context with Response Status Code set to 201 and\n Add a new @context with Response does not contain a body and\n Add a new @context with Response reason set to 'Created' and\n Serve a @context with Check that the Kind of the @context is set to 'Hosted'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts'\n method set to 'POST'\n Add a new @context based on the payload defined in the file @context-cached-valid.json\n}", + "http_verb": "POST", + "endpoint": "jsonldContexts" + } + ], + "permutations": [ + "when" + ], + "robotpath": "jsonldContext/Provision/AddContext", + "robotfile": "050_01" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/050_02.json b/doc/files/jsonldContext/Provision/050_02.json new file mode 100644 index 0000000000000000000000000000000000000000..a71f1a4394400465578ab99291d954bfbc5291dd --- /dev/null +++ b/doc/files/jsonldContext/Provision/050_02.json @@ -0,0 +1,58 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/050_02", + "test_objective": "Check that you receive a 400 Bad Request creating a @context if the content is incorrect", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.2", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.2" + ], + "pics_selection": "", + "keywords": [ + "Add @context scenarios", + "Delete @context if it was created by error" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "050_02_01 Checking Incorrect Payload", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_02_01", + "doc": "Check that the payload include \"@context\"", + "tags": [ + "5_13_2", + "ctx-add", + "since_v1.5.1" + ], + "setup": null, + "teardown": "Delete @context if it was created by error", + "template": "Add @context scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Add a new @context with Response Status Code set to 400 and\n Add a new @context with Response reason set to 'Bad Request' and\n Add a new @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts'\n method set to 'POST'\n Add a new @context based on the payload defined in the file @context-incorrect.json\n}", + "http_verb": "POST", + "endpoint": "jsonldContexts" + }, + { + "name": "050_02_02 Checking Wrong JSON", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_02_02", + "doc": "Check that the payload include \"@context\"", + "tags": [ + "5_13_2", + "ctx-add", + "since_v1.5.1" + ], + "setup": null, + "teardown": "Delete @context if it was created by error", + "template": "Add @context scenarios", + "then": "then {\n the SUT sends a valid Response for the operations:\n Add a new @context with Response Status Code set to 400 and\n Add a new @context with Response reason set to 'Bad Request' and\n Add a new @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/InvalidRequest' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts'\n method set to 'POST'\n Add a new @context based on the payload defined in the file @context-wrong-json.json\n}", + "http_verb": "POST", + "endpoint": "jsonldContexts" + } + ], + "permutations": [ + "when" + ], + "robotpath": "jsonldContext/Provision/AddContext", + "robotfile": "050_02" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/050_03.json b/doc/files/jsonldContext/Provision/050_03.json new file mode 100644 index 0000000000000000000000000000000000000000..5697a34633efc02b73e74e615e26eb0b15f7f963 --- /dev/null +++ b/doc/files/jsonldContext/Provision/050_03.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/050_03", + "test_objective": "Check that you can create a implicitlycreated @context through creating a subscription", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.2", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.2" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "050_03_01 Check the creation of ImplicitelyCreted @context", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_03_01", + "doc": "Check that you can create a subscription", + "tags": [ + "5_13_2", + "since_v1.5.1", + "sub-create" + ], + "setup": null, + "teardown": "Delete Initial @context Data", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Subscription with Response Status Code set to 200 and\n Notification with Check that the Kind of the @context is set to 'ImplicitlyCreated'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts?${params_as_string}'\n method set to 'GET'\n List @contexts: and\n Query Parameter: details set to 'true' and\n Query Parameter: kind set to 'ImplicitlyCreated'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/AddContext", + "robotfile": "050_03" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/050_04.json b/doc/files/jsonldContext/Provision/050_04.json new file mode 100644 index 0000000000000000000000000000000000000000..69c8db3a12e5ad30962519dee3bf81abe56ffce9 --- /dev/null +++ b/doc/files/jsonldContext/Provision/050_04.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/050_04", + "test_objective": "Check that you can add a hosted @context with list of URIs and each of them are cached @coxtexts", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.2", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.2" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "050_04_01 Add a valid hosted @context with URIs and check that the URIs are Cached @contexts", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/050_04_01", + "doc": "Check that you can add a @context", + "tags": [ + "5_13_2", + "ctx-add", + "since_v1.5.1" + ], + "setup": null, + "teardown": "Delete Initial @context", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Add a new @context with Response Status Code set to 201 and\n Add a new @context with Response does not contain a body and\n Add a new @context with Response reason set to 'Created' and\n Serve a @context with Check that the Kind of the @context is set to 'Hosted' and\n Notification with Check that for each @context in the response body, they are of the type 'Cached'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts'\n method set to 'POST'\n Add a new @context based on the payload defined in the file @context-cached-valid.json\n}", + "http_verb": "POST", + "endpoint": "jsonldContexts" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/AddContext", + "robotfile": "050_04" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_01.json b/doc/files/jsonldContext/Provision/051_01.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee474db807e3fecfef3b1042ff456772c53c35a --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_01.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_01", + "test_objective": "Check that you can delete a previous created hosted @context without reload param", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial hosted @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "051_01_01 Delete a @context whose kind is hosted without reload param", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_01_01", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial hosted @context", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 204 and\n Delete a @context with Response reason set to 'No Content' and\n Delete a @context with Response does not contain a body\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${uri}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_01" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_02.json b/doc/files/jsonldContext/Provision/051_02.json new file mode 100644 index 0000000000000000000000000000000000000000..23e4e53f49f2bb7c0ae6bb2a94ebb01456270d6e --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_02.json @@ -0,0 +1,36 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_02", + "test_objective": "Check that you get an error when trying to delete an unknown @context identifier", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "051_02_01 Delete a @context with unknown @context identifier", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_02_01", + "doc": "Check that an error message is obtained in the response when we try to delete a @context with unknonwn id", + "tags": [ + "5_13_5", + "ctx-serve", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 404 and\n Delete a @context with Response reason set to 'Not Found' and\n Delete a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${random_url}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_02" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_03.json b/doc/files/jsonldContext/Provision/051_03.json new file mode 100644 index 0000000000000000000000000000000000000000..7d5c38a2c2115f3fcf89d26bc96fcb9a9e3b67e3 --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_03.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_03", + "test_objective": "Check that you can delete a previous created cached @context without reload param", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial cached @context", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Cached @context added from a URL.\n }", + "test_cases": [ + { + "name": "051_03_01 Delete a @context whose kind is cached without reload param", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_03_01", + "doc": "Check that you can delete a cached @context", + "tags": [ + "5_13_5", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial cached @context", + "teardown": "Delete Initial @context", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 204 and\n Delete a @context with Response reason set to 'No Content' and\n Delete a @context with Response does not contain a body\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${contextId}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_03" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_04.json b/doc/files/jsonldContext/Provision/051_04.json new file mode 100644 index 0000000000000000000000000000000000000000..2cbe982f92cbab01367a244fb19c6b36ce58be8f --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_04.json @@ -0,0 +1,111 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_04", + "test_objective": "Check that you get an error when try to delete a @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Delete a @context with wrong data", + "Create Initial @context", + "Delete Initial @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Hosted @context and the default Cached Core Context.\n }", + "test_cases": [ + { + "name": "051_04_01 Delete a @contexts with a wrong id and reload set to true", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_04_01", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Delete a @context with wrong data", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 404 and\n Delete a @context with Response reason set to 'Not Found' and\n Delete a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'wrong_id_context'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "051_04_02 Delete a @contexts with a wrong id and reload set to false", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_04_02", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Delete a @context with wrong data", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 404 and\n Delete a @context with Response reason set to 'Not Found' and\n Delete a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'wrong_id_context'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "051_04_03 Delete a @contexts with a wrong id and no reload value", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_04_03", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Delete a @context with wrong data", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 404 and\n Delete a @context with Response reason set to 'Not Found' and\n Delete a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'wrong_id_context'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "051_04_04 Delete a @contexts with a wrong id and wrong reload value", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_04_04", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Delete a @context with wrong data", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 404 and\n Delete a @context with Response reason set to 'Not Found' and\n Delete a @context with Response Body containing the type '${ERROR_TYPE_RESOURCE_NOT_FOUND}' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'wrong_id_context'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "051_04_05 Delete a Hosted @contexts with a valid id and reload set to true", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_04_05", + "doc": "Check that you can delete a hosted @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create Initial @context", + "teardown": "Delete Initial @context", + "template": "Delete a @context with wrong data", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 400 and\n Delete a @context with Response reason set to 'Bad Request' and\n Delete a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${uri}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_04" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_05.json b/doc/files/jsonldContext/Provision/051_05.json new file mode 100644 index 0000000000000000000000000000000000000000..65b9618e2ded7642c6415db5e802e7973260eaf3 --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_05.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_05", + "test_objective": "Check that you get an error if we created an entity with a context (Cached context) and we try to delete it with reload=true", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial @context condition from an external server", + "Delete Initial @context condition from an external server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a Cached @context created from a entity creation through downloading from external server.\n }", + "test_cases": [ + { + "name": "051_05_01 Delete and Reload a Cached @context with no communication with the Context Server", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_05_01", + "doc": "Check that you get an error if we try to reload a cached context with no communication with the context server", + "tags": [ + "5_13_5", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create Initial @context condition from an external server", + "teardown": "Delete Initial @context condition from an external server", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 503 and\n Delete a @context with Response reason set to 'Service Unavailable' and\n Delete a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${uri}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_05" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_06.json b/doc/files/jsonldContext/Provision/051_06.json new file mode 100644 index 0000000000000000000000000000000000000000..c9605a8401ecf56b1b228e7c231af3e8bb903734 --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_06.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_06", + "test_objective": "Delete a @context whose kind is ImplicitlyCreated without reload param", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Create initial ImplicitlyCreated @context", + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a ImplicitlyCreated @context created from a subscription query.\n }", + "test_cases": [ + { + "name": "051_06_01 Delete a @context whose kind is ImplicitlyCreated without reload param", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_06_01", + "doc": "Check that we can delete a ImplicitlyCreated @context", + "tags": [ + "5_13_5", + "ctx-serve", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 204 and\n Delete a @context with Response reason set to 'No Content' and\n Delete a @context with Response does not contain a body\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${implicit_id}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_06" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_07.json b/doc/files/jsonldContext/Provision/051_07.json new file mode 100644 index 0000000000000000000000000000000000000000..2eb8260153118ae87f5b9741f03ee7b3b64c816c --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_07.json @@ -0,0 +1,39 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_07", + "test_objective": "Check that you cannot delete a ImplicitlyCreated @context with reload set to true", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Create initial ImplicitlyCreated @context", + "Delete Initial @context Data" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a ImplicitlyCreated @context created from a subscription query.\n }", + "test_cases": [ + { + "name": "051_07_01 Delete a ImplicitlyCreated @contexts with a valid id and reload set to true", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_07_01", + "doc": "Check that you cannot delete a ImplicitlyCreated @context with reload set to true", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Create initial ImplicitlyCreated @context", + "teardown": "Delete Initial @context Data", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 400 and\n Delete a @context with Response reason set to 'Bad Request' and\n Delete a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to '${implicit_id}'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_07" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_08.json b/doc/files/jsonldContext/Provision/051_08.json new file mode 100644 index 0000000000000000000000000000000000000000..87b06de633348bd20fd9211953191d4b30b5953b --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_08.json @@ -0,0 +1,55 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_08", + "test_objective": "Check that you get an error when try to delete the core @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Delete a core @context" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "051_08_01 Delete a core @contexts and return an error with no reload", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_08_01", + "doc": "Check that you get an error when try to delete the core @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "Delete a core @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 400 and\n Delete a @context with Response reason set to 'Bad Request' and\n Delete a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + }, + { + "name": "051_08_02 Delete a core @contexts and return an error with reload set to false", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_08_02", + "doc": "Check that you get an error when try to delete the core @context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": null, + "teardown": null, + "template": "Delete a core @context", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete a @context with Response Status Code set to 400 and\n Delete a @context with Response reason set to 'Bad Request' and\n Delete a @context with Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and Response Body Title is a string and is not ${EMPTY} and Response Body Detail is a string and is not ${EMPTY} and Response Boty Title is not equal to Response Body Detail\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'DELETE'\n Delete a @context whose 'URI' set to 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld'\n}", + "http_verb": "DELETE", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_08" +} \ No newline at end of file diff --git a/doc/files/jsonldContext/Provision/051_09.json b/doc/files/jsonldContext/Provision/051_09.json new file mode 100644 index 0000000000000000000000000000000000000000..74fc282a6fcd8c23959575c102be6a1448904e89 --- /dev/null +++ b/doc/files/jsonldContext/Provision/051_09.json @@ -0,0 +1,38 @@ +{ + "tp_id": "TP/NGSI-LD/CTX/Prov/051_09", + "test_objective": "Check that you get an error when try to delete the core @context", + "reference": "ETSI GS CIM 009 V1.5.1 [], clause 5.13.5", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.13.5" + ], + "pics_selection": "", + "keywords": [ + "Delete core context and reload it" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing a core context and it has been deleted with reload set to true.\n }", + "test_cases": [ + { + "name": "051_09_01 Delete a core @contexts with reload set to true and check if the context has been download again by the broker", + "permutation_tp_id": "TP/NGSI-LD/CTX/Prov/051_09_01", + "doc": "Delete a core @contexts with reload set to true and check downloaded core context", + "tags": [ + "5_13_5", + "ctx-delete", + "since_v1.5.1" + ], + "setup": "Delete core context and reload it", + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response for the operation:\n Serve a @context with Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/jsonldContexts/{contextId}'\n method set to 'GET'\n Serve a @context with contextID 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld' and details 'true'\n}", + "http_verb": "GET", + "endpoint": "jsonldContexts/{contextId}" + } + ], + "permutations": [], + "robotpath": "jsonldContext/Provision/DeleteContext", + "robotfile": "051_09" +} \ No newline at end of file diff --git a/doc/tests/test_CheckTests.py b/doc/tests/test_CheckTests.py index e151767e2b3955e78f5f609227f98263da46e41d..0845934a0c96cf22501bb0bb0210fc8849591874 100644 --- a/doc/tests/test_CheckTests.py +++ b/doc/tests/test_CheckTests.py @@ -3,6 +3,7 @@ from re import findall from unittest import TestCase from os.path import dirname, join, basename, splitext from os import walk +from json import dumps class TestCheckTests(TestCase): @@ -60,8 +61,9 @@ class TestCheckTests(TestCase): def test_specific_robot_file_has_a_test(self): check = [item for item in self.robots if item not in self.tests] check = [item for item in self.robot_files if any(string in item for string in check)] + check = dumps(check, indent=4) - assert len(check) == 0, f"The following robot files are missing from unittest:\n '{check}'" + assert check == '[]', f"The following robot files are missing from unittest:\n '{check}'" def test_that_all_tests_have_the_corresponding_robot_files(self): check = [item for item in self.tests if item not in self.robots] diff --git a/doc/tests/test_ContextInformation_Subscription.py b/doc/tests/test_ContextInformation_Subscription.py index 404842ac693955a17b367325241c0e0316f6b272..265e10d4c5eb3c5fadcd4b10ac55d9b0cd5e5951 100644 --- a/doc/tests/test_ContextInformation_Subscription.py +++ b/doc/tests/test_ContextInformation_Subscription.py @@ -294,8 +294,6 @@ class TestCISubscription(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) - print("WARNING, (029_06) there is a important miss alignment with the documentation") - def test_029_07(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_07.json' @@ -317,8 +315,6 @@ class TestCISubscription(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) - print("WARNING, (029_09) there is a important miss alignment with the documentation") - def test_029_10(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_10.json' @@ -326,8 +322,6 @@ class TestCISubscription(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) - print("WARNING, (029_10) there is a important miss alignment with the documentation") - def test_029_11(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Subscription/029_11.json' diff --git a/doc/tests/test_jsonldContext_Consumption.py b/doc/tests/test_jsonldContext_Consumption.py new file mode 100644 index 0000000000000000000000000000000000000000..e308f3c44d607512c1ed8c802c0f3196cae25f98 --- /dev/null +++ b/doc/tests/test_jsonldContext_Consumption.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestContextServerConsumption(TestCase): + # 14 failed, 26 passed + @classmethod + def setUpClass(cls): + TestContextServerConsumption.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestContextServerConsumption.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_052_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_052_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_052_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_052_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_052_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_052_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/052_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_052_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_053_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Consumption/053_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_053_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_jsonldContext_Provision.py b/doc/tests/test_jsonldContext_Provision.py new file mode 100644 index 0000000000000000000000000000000000000000..01270c6184bcbcac539ed98f495c484485760c69 --- /dev/null +++ b/doc/tests/test_jsonldContext_Provision.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestContextServerProvision(TestCase): + # 14 failed, 26 passed + @classmethod + def setUpClass(cls): + TestContextServerProvision.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestContextServerProvision.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_050_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/050_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_050_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_050_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/050_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_050_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_050_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/050_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_050_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_050_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/050_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_050_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_051_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/jsonldContext/Provision/051_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_051_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index 86ae646174403b0914df6c10b329b639f166ccc9..8a32ca2e8278d86184f25110ba44d0ec31b01f67 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -146,6 +146,24 @@ Create Entity Output ${response} Create Entity RETURN ${response} +Create Entity selecting @context + [Arguments] ${filename} ${context} ${entity_id}=${EMPTY} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/jsonldContext/${filename} + ${entity}= Update Value To JSON ${entity_payload} $..@context ${context} + + IF '${entity_id}'!='' + ${entity}= Update Value To JSON ${entity} $..id ${entity_id} + END + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... json=${entity} + ... headers=${headers} + ... expected_status=any + Output ${response} Create Entity selecting @context + RETURN ${response} + 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} diff --git a/resources/ApiUtils/jsonldContext.resource b/resources/ApiUtils/jsonldContext.resource new file mode 100644 index 0000000000000000000000000000000000000000..1546e9d31b142335ff643e37123b10b7a28a6b43 --- /dev/null +++ b/resources/ApiUtils/jsonldContext.resource @@ -0,0 +1,103 @@ +*** Settings *** +Variables ${EXECDIR}/resources/variables.py +Library ${EXECDIR}/libraries/logUtils.py +Library Collections +Library RequestsLibrary +Library OperatingSystem + + +*** Variables *** +${JSONLDCONTEXTS_ENDPOINT_PATH} jsonldContexts + +${CONTENT_TYPE_JSON} application/json + +${response} ${EMPTY} + +@{ALLOWED_CONTEXT} Cached Hosted ImplicitlyCreated UserCreated + +${ERROR_OPERATION_NOT_SUPPORTED} https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData + + +*** Keywords *** +Add a new @context + [Arguments] ${filename} + + ${file_content}= Get File ${EXECDIR}/data/jsonldContext/${filename} + + &{headers}= Create Dictionary Content-Type=application/json + ${response}= POST + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + + Output ${response} Add a new @context + RETURN ${response} + +Serve a @context + [Arguments] ${contextId} ${details}=${EMPTY} + + IF '${details}'!='' + &{params}= Create Dictionary + Set To Dictionary ${params} details=${details} + + ${response}= GET + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... params=${params} + ... expected_status=any + ELSE + ${response}= GET + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... expected_status=any + END + + Output ${response} Serve a @context + RETURN ${response} + +Delete a @context + [Arguments] ${contextId} ${reload}=${EMPTY} + + IF '${reload}'!='' + &{params}= Create Dictionary + Set To Dictionary ${params} reload=${reload} + + ${response}= DELETE + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... params=${params} + ... expected_status=any + ELSE + ${response}= DELETE + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... expected_status=any + END + + Output ${response} Delete a @context + RETURN ${response} + +List @contexts + [Arguments] ${details}=${EMPTY} ${kind}=${EMPTY} + + &{params}= Create Dictionary + + IF '${details}'=='' and '${kind}'=='' + ${response}= GET + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH} + ... expected_status=any + ELSE + IF '${details}'!='' + Set To Dictionary ${params} details=${details} + END + + IF '${kind}'!='' Set To Dictionary ${params} kind=${kind} + + ${string_list}= Evaluate [f'{key}={value}' for key, value in ${params}.items()] + ${params_as_string}= Evaluate '&'.join(${string_list}) + + ${response}= GET + ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}?${params_as_string} + ... expected_status=any + END + + Output ${response} List @contexts + RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5d6c646d626ab7fe4b506fa5a2b337ca3db4461d..ae114f3c3e6cfd95548746061bb57b192cd3d003 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,10 +1,12 @@ *** Settings *** Library ${EXECDIR}/libraries/assertionUtils.py +Library ${EXECDIR}/libraries/dateTimeUtils.py Library RequestsLibrary Library Collections Library JSONLibrary Library String Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource *** Variables *** @@ -386,6 +388,10 @@ Check Response Reason set to [Arguments] ${response_reason} ${reason} Should Be Equal ${response_reason} ${reason} +Check Response Kind set to + [Arguments] ${response} ${kind} + Should Be Equal ${response['kind']} ${kind} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response_body} ${type} ${json_response_body}= Set Variable ${response_body} @@ -484,17 +490,17 @@ Check Retrieving Context Source Registration ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} -Check Dictionary Might Contain Additional Members of the NotificationParams +Check Response Body Might Contain Additional Members of the NotificationParams # Check the Additional Members 5.2.14.2 in the NotificationParams data structure [Arguments] ${dictionary} ${key} - Log Dictionary Might Contain Key with a specific type - Log Dictionary: ${dictionary} + Log Check Response Body Might Contain Additional Members of the NotificationParams + Log Response Body: ${dictionary} Log Key: ${key} ${value}= Evaluate $dictionary.get($key) IF '${value}' != '' and '${value}' != 'None' - IF "${key}" == "lastNotification" or "${key}" == "lastFailure" or "${key}" == "lastSuccess" or "${key}" == "expiresAt" + IF "${key}" == "lastNotification" or "${key}" == "lastFailure" or "${key}" == "lastSuccess" # Need to check that there is a DateTime value ${type date}= Parse Ngsild Date ${dictionary}[${key}] Should Not Be Equal @@ -502,7 +508,36 @@ Check Dictionary Might Contain Additional Members of the NotificationParams ... ${None} ... The Additional Member ${key} contains a value (${value}) that it is not in DateTime format END - IF "${key}" == "timesSent" or "${key}" == "throttling" or "${key}" == "timeInterval" + IF "${key}" == "timesSent" + # Need to check that there is a Integer value + ${type int}= Evaluate type(${dictionary}[${key}]).__name__ + Should Be Equal + ... ${type int} + ... int + ... The Additonal Member ${key} contains a value (${value}) that it is not in Number format + END + ELSE + Log The key '${key}' is not present in the dictionary + END + +Check Response Body Might Contain Optional Fields + [Arguments] ${dictionary} ${key} + Log Check Response Body Might Contain Optional Fields + Log Response Body: ${dictionary} + Log Key: ${key} + + ${value}= Evaluate $dictionary.get($key) + + IF '${value}' != '' and '${value}' != 'None' + IF "${key}" == "expiresAt" or "${key}" == "lastUsage" + # Need to check that there is a DateTime value + ${type date}= Parse Ngsild Date ${dictionary}[${key}] + Should Not Be Equal + ... ${type date} + ... ${None} + ... The Additional Member ${key} contains a value (${value}) that it is not in DateTime format + END + IF "${key}" == "throttling" or "${key}" == "timeInterval" or "${key}" == "numberOfHits" # Need to check that there is a Integer value ${type int}= Evaluate type(${dictionary}[${key}]).__name__ Should Be Equal @@ -526,6 +561,7 @@ Check Dictionary Might Contain Additional Members of the NotificationParams ... str ... The Additonal Member ${key} contains a value (${value}) that it is not in String format END + IF "${key}" == "extraInfo" Log Found "extraInfo" key ELSE Log The key '${key}' is not present in the dictionary END @@ -546,3 +582,180 @@ Check Response Body Contains DateTime Value ... ${expected value} ... ${obtained value} ... The expected value (${expected value}) is not the same as the obtained value (${obtained value}) + +Check Context Response Body Content + [Arguments] ${expectation_filename} ${response_body} + + ${context_payload}= Load JSON From File ${EXECDIR}/data/jsonldContext/${expectation_filename} + Dictionaries Should Be Equal ${response_body} ${context_payload} + +Check Context Response Body Containing Detailed Information + [Arguments] ${response_body} ${context_type} + + Should Not Be Empty ${response_body['URL']} + Should Not Be Empty ${response_body['localId']} + Should Not Be Empty ${response_body['kind']} + + Should Be String ${response_body['URL']} + Should Be String ${response_body['localId']} + Should Be String ${response_body['kind']} + + IF $response_body['kind'] not in $ALLOWED_CONTEXT + fail The value of kind:"${response_body['kind']}" is not allowed + END + + Should Be Equal ${response_body['kind']} ${context_type} + + # TODO: v1.8.1 change timestamp -> createdAt + Should Not Be Empty ${response_body['timestamp']} + ${date}= Parse Ngsild Date ${response_body['timestamp']} + Should Not Be Equal + ... ${date} + ... ${None} + ... The createdAt key contains a value (${response_body['timestamp']}) that it is not in DateTime format + +Check Context Response Body Containing numberOfHits value + [Arguments] ${response_body} ${expected_number_of_hists} + + ${value}= Evaluate $response_body.get('numberOfHits') + + IF '${value}' != '' and '${value}' != 'None' + Log Expected number of hits: ${expected_number_of_hists} + Log Received number of hits: ${response_body['numberOfHits']} + + Should Be Equal As Numbers ${response_body['numberOfHits']} ${expected_number_of_hists} + END + +Check Context Response Kind + [Arguments] ${response_body} ${context_type} + + Should Be Equal ${response_body['kind']} ${context_type} + +Check Context Response Body Containing a list of identifiers + [Arguments] ${response_body} ${expected_length} ${list_contexts}=${EMPTY} ${kind}=${EMPTY} + + Length Should Be + ... ${response_body} + ... ${expected_length} + ... msg=The length of the strings array of @contexts is not ${expected_length} + + IF ${expected_length}==0 + Should Be Empty ${response_body} + ELSE + IF ${expected_length}==1 + ${length_list_contexts}= Get Length ${list_contexts} + IF '${kind}' == 'Cached' or ${length_list_contexts} == 0 + Should Be Equal ${response_body[0]} ${core_context} + ELSE + List Should Contain Value + ... ${list_contexts} + ... ${response_body[0]} + ... msg=The received @context ${response_body[0]} is not included in the list of expected @contexts: ${list_contexts} + END + ELSE + IF ${expected_length}>1 + IF '${kind}' == '' + Should Be Equal ${response_body[0]} ${core_context} + ELSE + FOR ${index} ${uri_context} IN ENUMERATE @{list_contexts} + Should Be Equal ${response_body[${index}]} ${uri_context} + END + END + END + END + END + +Check Context Response Body Containing a list with several URLs + [Arguments] ${response_body} ${expected_length} ${list_contexts} + + Length Should Be + ... ${response_body} + ... ${expected_length} + ... msg=The length of the strings array of @contexts is not ${expected_length} + + Should Be Equal ${response_body[0]} ${core_context} + + FOR ${index} ${uri_context} IN ENUMERATE @{list_contexts} + Log URI: ${uri_context} index: ${index} + ${index}= Evaluate ${index} + 1 + + Should Be Equal ${response_body[${index}]} ${uri_context} + END + +Check Cached @Contexts + [Arguments] ${filename} + + ${entity_payload}= Load JSON From File ${EXECDIR}/data/jsonldContext/${filename} + ${contexts}= Get From Dictionary ${entity_payload} @context + + &{params}= Create Dictionary + Set To Dictionary ${params} details=true + + FOR ${contextId} IN @{contexts} + ${response}= Serve a @context ${contextId} true + Check Response Kind set to ${response.json()} Cached + END + +Check Context Detailed Information Keys + [Arguments] ${my_dict} + + # TODO: spec v1.8.1 timestamp -> createdAt + ${expected_keys}= Create List URL localId kind createdAt lastUsage numberOfHits extraInfo + ${actual_keys}= Get Dictionary Keys ${my_dict} + + FOR ${key} IN @{expected_keys} + Remove Values From List ${actual_keys} ${key} + END + + Should Be Empty + ... ${actual_keys} + ... msg=The @context detailed information contains keys not expected: ${actual_keys} + +Check Context Response Body Containing a JSONObject with details of the @contexts + [Arguments] ${response} ${expected_length} ${list_contexts} + + ${obtained_length}= Get Length ${response} + Length Should Be + ... ${response} + ... ${expected_length} + ... msg=The expected number of @contexts was ${expected_length} but we have obtained ${obtained_length} + + FOR ${index} ${item} IN ENUMERATE @{response} + ${URL}= Get From Dictionary ${item} URL + IF '${URL}'=='${core_context}' + ${context_kind}= Set Variable Cached + ELSE + ${context_kind}= Set Variable Hosted + END + + # Check mandatory keys in the response (URL, localId, kind, timestamp) and their possible values + Check Context Response Body Containing Detailed Information ${item} ${context_kind} + + # Check optional keys in the response (lastUsage, numberOfHits, extraInfo) and their possible values + Check Response Body Might Contain Optional Fields ${response}[0] lastUsage + Check Response Body Might Contain Optional Fields ${response}[0] numberOfHits + Check Response Body Might Contain Optional Fields ${response}[0] extraInfo + + # Check that there is no other keys + Check Context Detailed Information Keys ${item} + END + +Check Context Response Body Containing a JSONObject with details of a ImplicitlyCreated @contexts + [Arguments] ${response} ${expected_length} + + ${obtained_length}= Get Length ${response} + Length Should Be + ... ${response} + ... ${expected_length} + ... msg=The expected number of @contexts was ${expected_length} but we have obtained ${obtained_length} + + # Check mandatory keys in the response (URL, localId, kind, timestamp) and their possible values + Check Context Response Body Containing Detailed Information ${response}[0] ImplicitlyCreated + + # Check optional keys in the response (lastUsage, numberOfHits, extraInfo) and their possible values + Check Response Body Might Contain Optional Fields ${response}[0] lastUsage + Check Response Body Might Contain Optional Fields ${response}[0] numberOfHits + Check Response Body Might Contain Optional Fields ${response}[0] extraInfo + + # Check that there is no other keys + Check Context Detailed Information Keys ${response}[0] diff --git a/resources/ContextServerUtils.resource b/resources/ContextServerUtils.resource new file mode 100644 index 0000000000000000000000000000000000000000..4eeb0957278c0b3ddbf49fa8bffc649bcad691b3 --- /dev/null +++ b/resources/ContextServerUtils.resource @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Create a mock server to response to the Context Broker with the corresponding @context + +Variables ${EXECDIR}/resources/variables.py +Library HttpCtrl.Server +Library OperatingSystem + + +*** Variables *** +${filename}= @context-minimal-valid.json + + +*** Keywords *** +Start @context Local Server + [Arguments] ${host}=${context_server_host} ${port}=${context_server_port} + + # Initialize HTTP Server + Start Server ${host} ${port} + + ${payload}= Get File ${EXECDIR}/data/jsonldContext/${filename} + + Set Stub Reply GET /api/v1/context.jsonld 200 ${payload} + +Stop @context Local Server + # Terminate HTTP Server + Stop Server diff --git a/resources/variables.py b/resources/variables.py index 1ecd8144e9b49d886a0ef95a826d6e5035a11299..1017093281036a3d8785ac7d67371fc1e8d8f3ac 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -5,6 +5,9 @@ notification_server_host = '0.0.0.0' notification_server_port = 8085 context_source_host = '0.0.0.0' context_source_port = 8086 +context_server_host = '0.0.0.0' +context_server_port = 8087 +core_context = 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld' # GitHub repository details # github_owner = 'your_github_username'