diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 364607e5fe582ace9b2f0880a5a2531e86744cfd..9a8d7ab3e226e8f643a0dd7a66391a0166e37ea1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -24,7 +24,7 @@ Query several entities based on a list of properties @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 70b83b93c1299e37f2815340339d8ddbdc18e0e7..9c86bba127612a4d74ff36d7a48201d7eeb5dd4a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_entity_id_pattern}= invalid_entity_id_pattern* +${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Test Cases *** Query several entities based on incorrect id pattern diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 5bc75782bb34c08f1f9f435320a5f399c85ff77b..292e09ad4f661b0d037aa768c3cb31915fc85d29 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -21,6 +21,6 @@ Create a batch of one entity using the default context with JSON content type Check Response Body Containing an Attribute set to almostFull Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://uri.etsi.org/ngsi-ld/default-context/almostFull + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index a1f79182f588a8b0db18b1db08cd595bbc9a6a3a..8a745d8ccc600c3111aaea6f32348b94ca6fd6a0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -3,9 +3,9 @@ Documentation Check that you can update a batch of entities Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Update Entity Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot index 46624211ce8c920072ff823b37b4bf0f79b115a2..2b13a47303546065cd7e9f30f282f3dc3dfdce7f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot @@ -17,6 +17,6 @@ Create Subscription With Invalid Request [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 Create Subscription From File ${filename} - Check RL Response Status Code Set To Expected Code 400 + Check RL Response Status Code Set To 400 Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 99b1e92e9444d4188ad5e169b142425752b733bf..8b87d7930dd3ba4df0aaf6b3c923275cc04b6f5c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -43,7 +43,7 @@ After Test *** Test Case *** -Check that a notification is sent on the timeinterval +Check that a notification is sent on the timeInterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 046_02 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index f178fd22598adaf79121f095ef7196f562662545..65dad24b3307111ce5ca55b0e8d5d9a9027d9347 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -1,14 +1,11 @@ *** Settings *** Documentation Check that a notification is only sent if and only if the status is active - - - Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test +Suite Setup Before Test Suite Teardown After Test *** Variable *** @@ -56,7 +53,7 @@ Check notification structure Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -73,7 +70,7 @@ Check correct attributes are included Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -91,7 +88,7 @@ Check URI expansion is observed Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index a7dab7538e00f4641549a4fea0704a60eba9cf94..e91b9ac8316c398f6091bf296697f35a015d7466 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -83,7 +83,7 @@ Check that a notification is sent with all attributes in simplified format ${notification}= Wait for notification ${5} Output ${notification} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification ${list_count}= Count Values In List ${notification} Should Not Be Equal ${list_count} 0 Should Be Equal ${notification}[0][id] ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 46d790d17519408c25a69a35fedaef04d2fc6c38..907e3c0db4971802a782d620a62fb955e2d9b859 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -47,7 +47,7 @@ Delete Initial Entity *** Test Cases *** Check that a notification is JSON - [Documentation] The Notification content shall be JSON by defaul + [Documentation] The Notification content shall be JSON by default [Tags] sub-notification 5_11_7 046_10 Add Initial Entity @@ -55,7 +55,7 @@ Check that a notification is JSON Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait For Request ${timeout} + Wait For Request 10 Reply By 200 ${notification_payload}= Get Request Body diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index fec85f5c6506fbd401eabab541f0ab7dda83aa9e..75c3d71bef0cc83d4b7c5469ffd7126427bb5b85 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -5,31 +5,24 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Setup Initial Subscription +Suite Teardown Delete Initial Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${fragment_filename}= airQualityLevel-fragment.jsonld - - - -*** Keywords *** +*** Test Case *** Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + [Tags] sub-notification 5_11_7 046_13 ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for redirected request @@ -42,11 +35,10 @@ Check that a notification is only sent if statis is active Setup Initial Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} -Delete Subscription +Delete Initial Subscription Stop Local Server Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 44e3ff205ff8f0e7c2adbf40f37111f651debf2e..81b2b8a7789013b1e91dc22e3984f85cdf728d05 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -4,46 +4,38 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Resource ${EXECDIR}/resources/MockServerUtils.resource +Suite Setup Setup Initial Subscription +Suite Teardown Delete Initial Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${fragment_filename}= airQualityLevel-fragment.jsonld - - - -*** Keywords *** +*** Test Case *** Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + [Tags] sub-notification 5_11_7 046_14 ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for redirected failed request @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} - *** Keywords *** Setup Initial Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} -Delete Subscription +Delete Initial Subscription Stop Local Server Delete Subscription ${subscription_id} diff --git a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json index 42d6c58f4bf548fdc25c823c67e20bc5815d05e6..e672a7f74904c271c85e0f7bc044840cc240ad16 100644 --- a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json +++ b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json @@ -6,6 +6,7 @@ "type": "https://ngsi-ld-test-suite/context#Building" } ], + "timeInterval": 5, "notification": { "endpoint": { "accept": "application/json", diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index cba71b772f45289e8035d51b6656aa3d7faa9594..1cda399b3e995a3f8607694df609da826c68ccdb 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "location": { "type": "GeoProperty", diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld index 0bb447e83a15fb1ccc0d3d68d58a5c63a24156dd..e03c467a87c85635a5dbed50b16062fa1295bd36 100644 --- a/data/entities/building-location-attribute.jsonld +++ b/data/entities/building-location-attribute.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "location": { "type": "GeoProperty", diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 2b21215c3fbc0d3d274970607316b9f4641803e0..5518b700a4c6d390f82a7bbb2a8950b0b9959ba1 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", diff --git a/data/entities/building-simple-attributes-sample.json b/data/entities/building-simple-attributes-sample.json index c0beff52e7ef76265db017a5a9451b68f210e7c7..7b86aadd7f4f55f4990d69aed8c5732572a7f42e 100644 --- a/data/entities/building-simple-attributes-sample.json +++ b/data/entities/building-simple-attributes-sample.json @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index dcf11f9f0574858b7551c056b507230c5491d2fd..499933157fc2977af7d5d73c37db21a2b003154d 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index 21ccd03c333d00fdcecd9add8297db8c4694ea53..6af4f40178c80ca199740757d7f5404f26752c42 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -1,7 +1,7 @@ { "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", - "timeinterval": 5, + "timeInterval": 5, "entities":[ { "type":"Building" diff --git a/data/types/expectations/attribute-026-01-01-expectation.json b/data/types/expectations/attribute-026-01-01-expectation.json index 19b88b32e2ae7974d99c78fce44af8af8dd65c2f..d5fe0f283359e361f69aeb120281d9f581ae03bb 100644 --- a/data/types/expectations/attribute-026-01-01-expectation.json +++ b/data/types/expectations/attribute-026-01-01-expectation.json @@ -3,10 +3,6 @@ "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -15,10 +11,6 @@ "id":"https://ngsi-ld-test-suite/context#subCategory", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#subCategory", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -27,10 +19,6 @@ "id":"https://ngsi-ld-test-suite/context#airQualityLevel", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#airQualityLevel", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -39,10 +27,6 @@ "id":"https://ngsi-ld-test-suite/context#almostFull", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#almostFull", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] diff --git a/data/types/expectations/attribute-026-01-02-expectation.json b/data/types/expectations/attribute-026-01-02-expectation.json index 076b9e4f3f97d57869ddef0111b93c340c5edd74..6997eaf6d9fc87422494c0e560b74e25599b29d8 100644 --- a/data/types/expectations/attribute-026-01-02-expectation.json +++ b/data/types/expectations/attribute-026-01-02-expectation.json @@ -3,10 +3,6 @@ "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -15,10 +11,6 @@ "id":"https://ngsi-ld-test-suite/context#subCategory", "type":"Attribute", "attributeName":"subCategory", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -27,10 +19,6 @@ "id":"https://ngsi-ld-test-suite/context#airQualityLevel", "type":"Attribute", "attributeName":"airQualityLevel", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -39,10 +27,6 @@ "id":"https://ngsi-ld-test-suite/context#almostFull", "type":"Attribute", "attributeName":"almostFull", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] diff --git a/data/types/expectations/entity-type-023-01-01-expectation.json b/data/types/expectations/entity-type-023-01-01-expectation.json index e938df4f397b293567d3b36d43c93072b8404a19..a192383199021914a7552174103630cdbae0d3f8 100644 --- a/data/types/expectations/entity-type-023-01-01-expectation.json +++ b/data/types/expectations/entity-type-023-01-01-expectation.json @@ -4,7 +4,7 @@ "type":"EntityType", "typeName":"https://ngsi-ld-test-suite/context#Building", "attributeNames":[ - "name", + "https://ngsi-ld-test-suite/context#name", "https://ngsi-ld-test-suite/context#subCategory", "https://ngsi-ld-test-suite/context#airQualityLevel", "https://ngsi-ld-test-suite/context#almostFull" diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 8b417f577dc93d8e6458669f9ed34bb2270bcda0..d47c4d95f0caa853bb122c415c263994061cce36 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -705,7 +705,8 @@ Create Subscription From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} Create Session SubscriptionCreateRequest ${url} - ${response}= PATCH On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} expected_status=any + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any Set Test Variable ${response} Update Subscription @@ -745,9 +746,9 @@ Query Subscriptions Set Test Variable ${response} Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary + [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 1a8e33f13ff24bbf07a6a9b62355d0faa06fb4ce..d207b58e2d5b2cabcc8b1527a9e367a924f03da2 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -111,7 +111,7 @@ Check Response Body Containing List Containing Entity Elements With Different Ty ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element @@ -219,7 +219,7 @@ Check Response Body Containing List Containing Context Source Registrations elem ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id + ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index e0d162f90fb47d436c01f088007f511acc0b2766..fa46cdd3614f3d0b547b2110f157c540099f62ff 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -5,7 +5,7 @@ Library HttpCtrl.Server *** Keywords *** Start Context Source Mock Server #Initialize HTTP Client And Server - Start Server 0.0.0.0 8086 + Start Server ${context_source_host} ${context_source_port} Wait for redirected request [Arguments] ${timeout}=${5} diff --git a/resources/MockSubscriberServer.resource b/resources/MockSubscriberServer.resource deleted file mode 100644 index e4e3b856ad8557471b9b8a33f95f6a9ca196501c..0000000000000000000000000000000000000000 --- a/resources/MockSubscriberServer.resource +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Documentation Check Notification Behaviour -Library BuiltIn -Library Collections -Library HttpCtrl.Server -Library ${EXECDIR}/libraries/assertionUtils.py -Library ${EXECDIR}/libraries/dateTimeUtils.py - -*** Variable *** -${notification_type}= subscriber Notfication -${date_format}= %Y-%m-%dT%H:%M:%SZ - - -*** Keywords *** -Start Local Server - #Initialize HTTP Client And Server - Start Server 0.0.0.0 8085 - -Wait for redirected request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 200 - -Stop Local Server - #Terminate HTTP Server - Stop Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 20146267e6bd9ae2e735b755558c16ffe4baa7e7..8d0c0d928980a6617204ae5d07958d40dfa0a436 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -64,7 +64,6 @@ Wait for notification and validate it Wait for subscription notification and validate it [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} ${expected_notification_type}=${notification_type} - Wait for subscription notification ${expected_subscription_id} ${expected_notification_data_entities} ${timeout} ${expected_notification_type} #HTTP server receives it and checks incoming request for correctness #.. "Wait For Request" #.... This call is blocked until HTTP request arrives or timeout. @@ -89,8 +88,6 @@ Wait for subscription notification and validate it Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} [return] ${notification} - - Wait for no notification [Arguments] ${timeout}=${5} #HTTP server receives it and checks incoming request for correctness @@ -110,28 +107,6 @@ Check Notification Data Entities Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True - -Check Notification Date - [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 200 - - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json - ${notification_data_length}= Get length ${notification}[data] - ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} - - - log ${notification} - ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - Should Be True ${is_date} - - - Stop Local Server #Terminate HTTP Server Stop Server