diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index 5600e7a69d66492626be30464230713c3f999e7a..c83fdc6a7467db20ea0d5722b2242bb8eb093e6c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -8,7 +8,7 @@ Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] mandatory - Delete Subscription unknownSubscription + Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index bca5702225d421b57a4dc9cb0a125b8672f71034..7c77ef6bc3c55c1b093c357084f0cb8ef924800b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -8,7 +8,7 @@ Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] mandatory - Retrieve Subscription unknownSubscription + Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 1cfdfa2d49e6a1fd1e23374e84d9d6f21f28e6fe..79aaaf51b6efc952ece41abc8f9eecb87b8e6106 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -10,6 +10,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json *** Test Case *** Retrieve Subscription @@ -19,7 +20,7 @@ Retrieve Subscription Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 3c64d3109eec03014c5768d07068609a7d26677e..2ad714bc18a1aa86109d45a6cff94f068197d8e3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -12,7 +12,7 @@ Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] mandatory - Update Subscription unknownSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 60aca577c7144f385aff2857ada780b8124fa2dd..08d3fc89c3a50a29afa7aa6989c69347eed5d428 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -11,8 +11,8 @@ Suite Teardown Delete Initial Subscriptions ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json -${expected_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-sample.jsonld -${expected_expanded_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld +${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld +${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld *** Test Case *** Update Subscription With Term to Uri Expansion diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 065e4771e2716c0a229c0d8452480b25c924e928..0da3e65b5cbd55a98f71051d111789865591ac27 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -10,6 +10,7 @@ Suite Teardown Delete Created Context Source Registration Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json *** Test Case *** Retrieve Context Source Registration Subscription @@ -19,7 +20,7 @@ Retrieve Context Source Registration Subscription Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Context Source Registration Subscription diff --git a/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json b/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json new file mode 100644 index 0000000000000000000000000000000000000000..6ebc609265a13c73e86273f48afe9e45303dfc93 --- /dev/null +++ b/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "isActive": true, + "status": "active" +} \ No newline at end of file diff --git a/data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld similarity index 100% rename from data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld rename to data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld diff --git a/data/subscriptions/expected/subscription-vehicle-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld similarity index 100% rename from data/subscriptions/expected/subscription-vehicle-sample.jsonld rename to data/subscriptions/expectations/subscription-vehicle-sample.jsonld diff --git a/data/subscriptions/expectations/subscriptions-030-03-expectation.json b/data/subscriptions/expectations/subscriptions-030-03-expectation.json new file mode 100644 index 0000000000000000000000000000000000000000..6ebc609265a13c73e86273f48afe9e45303dfc93 --- /dev/null +++ b/data/subscriptions/expectations/subscriptions-030-03-expectation.json @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "isActive": true, + "status": "active" +} \ No newline at end of file diff --git a/data/subscriptions/expectations/subscriptions-031-01-expectation.json b/data/subscriptions/expectations/subscriptions-031-01-expectation.json index cd952e1f2127a1c3b4a10801d313ae494a99fd7e..a4ee40ebbfed824213706c5d62081bbfac20c6d4 100644 --- a/data/subscriptions/expectations/subscriptions-031-01-expectation.json +++ b/data/subscriptions/expectations/subscriptions-031-01-expectation.json @@ -14,6 +14,7 @@ "accept":"application/json" } }, + "isActive": true, "status": "active" }, { @@ -35,6 +36,7 @@ "accept":"application/json" } }, + "isActive": true, "status": "active" }, { @@ -52,6 +54,7 @@ "accept":"application/json" } }, + "isActive": false, "status": "paused" } ] \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 4573716b22f4f1bdd7460ef2e4b5b58c716bcbf3..a338493930f5b025a7635b31c0d7a97f5fbe4f86 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -7,7 +7,6 @@ ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] ${context_regex_expr}= root\\['@context'\\] -${status_regex_expr}= root\\['status'\\] *** Keywords *** Check Response Status Code @@ -135,7 +134,7 @@ Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${ignored_keys}= Create List ${status_regex_expr} ${context_regex_expr} + ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} Should Be True ${comparison_result} msg=Subscription Comparison Failed @@ -147,7 +146,8 @@ Check Response Body Containing List Containing Subscription elements ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${ignored_keys} Should Be True ${comparison_result} msg=Subscription Comparison Failed # Since response body can be a json object if it contains one element