Loading TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot 0 → 100644 +40 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that one cannot create a subscription with invalid or unavailable jsonldContext Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Create Subscription With Invalid/Unavailable JsonldContext *** Variables *** ${invalid_jsonldContext_subscription_file_path}= subscriptions/subscription-building-with-invalid-jsonldContext.jsonld ${unavailable_jsonldContext_subscription_file_path}= subscriptions/subscription-building-with-unavailable-jsonldContext.jsonld *** Test Cases *** FILE_NAME EXPECTED_ERROR_TYPE EXPECTED_STATUS_CODE 028_07_01 Subscription with invalid jsonldContext [Tags] sub-create 5_8_1 since_v1.7.1 ${invalid_jsonldContext_subscription_file_path} ${ERROR_TYPE_BAD_REQUEST_DATA} 400 028_07_02 Subscription with unavailable jsonldContext [Tags] sub-create 5_8_1 since_v1.7.1 ${unavailable_jsonldContext_subscription_file_path} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} 503 *** Keywords *** Create Subscription With Invalid/Unavailable JsonldContext [Documentation] Check that one cannot create a subscription with invalid or unavailable jsonldContext [Tags] sub-create 5_8_1 [Arguments] ${file_name} ${expected_error_type} ${expected_status_code} ${subscription_id}= Generate Random Subscription Id Set Suite Variable ${subscription_id} ${response}= Create Subscription ... ${subscription_id} ... ${file_name} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${expected_error_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_20.robot 0 → 100644 +74 −0 Original line number Diff line number Diff line *** Settings *** Documentation If a subscription has a jsonldContext member then it should be used when sending notifications. Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource Suite Setup Before Test Suite Teardown After Test *** Variables *** ${subscription_payload_file_path}= subscriptions/subscription-building-with-jsonldContext.jsonld ${entity_building_filepath}= building-minimal.jsonld ${fragment_filename}= building-name-fragment.jsonld ${notification_server_send_url}= http://${notification_server_host}:${notification_server_port}/notify ${entity_expectation_file_path}= compacted-entity-with-jsonldContext-046-20.jsonld *** Test Cases *** 046_20 Check that jsonldContext member in subscription is used when sending notifcations [Documentation] If a subscription has a jsonldContext member then it should be used when sending notifications [Tags] sub-notification 5_8_6 since_v1.7.1 ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] Check Notification Containing Entity Element ... ${entity_expectation_file_path} ... ${notification} *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} Add Initial Entity Sleep 1s Setup Initial Subscription Add Initial Entity ${entity_id}= Generate Random Building Entity Id ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Setup Initial Subscription ${subscription_id}= Generate Random Subscription Id ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} ${create_response}= Create Subscription From Subscription Payload ... ${subscription_payload} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} After Test Delete Initial Subscription Delete Initial Entity Stop Local Server Delete Initial Subscription Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id} data/subscriptions/expectations/compacted-entity-with-jsonldContext-046-20.jsonld 0 → 100644 +10 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Le Tour Eiffel", "datasetId": "urn:ngsi-ld:Dataset:french-name" }, "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" } No newline at end of file data/subscriptions/subscription-building-with-invalid-jsonldContext.jsonld 0 → 100644 +20 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Subscription:randomUUID", "type": "Subscription", "entities": [ { "type": "Building" } ], "notification": { "format": "normalized", "endpoint": { "uri": "http://my.endpoint.org/notify", "accept": "application/ld+json" } }, "jsonldContext": "unknownContext", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } No newline at end of file data/subscriptions/subscription-building-with-jsonldContext.jsonld 0 → 100644 +20 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Subscription:randomUUID", "type": "Subscription", "entities": [ { "type": "Building" } ], "notification": { "format": "normalized", "endpoint": { "uri": "http://my.endpoint.org/notify", "accept": "application/ld+json" } }, "jsonldContext": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } No newline at end of file Loading
TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot 0 → 100644 +40 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that one cannot create a subscription with invalid or unavailable jsonldContext Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Create Subscription With Invalid/Unavailable JsonldContext *** Variables *** ${invalid_jsonldContext_subscription_file_path}= subscriptions/subscription-building-with-invalid-jsonldContext.jsonld ${unavailable_jsonldContext_subscription_file_path}= subscriptions/subscription-building-with-unavailable-jsonldContext.jsonld *** Test Cases *** FILE_NAME EXPECTED_ERROR_TYPE EXPECTED_STATUS_CODE 028_07_01 Subscription with invalid jsonldContext [Tags] sub-create 5_8_1 since_v1.7.1 ${invalid_jsonldContext_subscription_file_path} ${ERROR_TYPE_BAD_REQUEST_DATA} 400 028_07_02 Subscription with unavailable jsonldContext [Tags] sub-create 5_8_1 since_v1.7.1 ${unavailable_jsonldContext_subscription_file_path} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} 503 *** Keywords *** Create Subscription With Invalid/Unavailable JsonldContext [Documentation] Check that one cannot create a subscription with invalid or unavailable jsonldContext [Tags] sub-create 5_8_1 [Arguments] ${file_name} ${expected_error_type} ${expected_status_code} ${subscription_id}= Generate Random Subscription Id Set Suite Variable ${subscription_id} ${response}= Create Subscription ... ${subscription_id} ... ${file_name} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${expected_error_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()}
TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_20.robot 0 → 100644 +74 −0 Original line number Diff line number Diff line *** Settings *** Documentation If a subscription has a jsonldContext member then it should be used when sending notifications. Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource Suite Setup Before Test Suite Teardown After Test *** Variables *** ${subscription_payload_file_path}= subscriptions/subscription-building-with-jsonldContext.jsonld ${entity_building_filepath}= building-minimal.jsonld ${fragment_filename}= building-name-fragment.jsonld ${notification_server_send_url}= http://${notification_server_host}:${notification_server_port}/notify ${entity_expectation_file_path}= compacted-entity-with-jsonldContext-046-20.jsonld *** Test Cases *** 046_20 Check that jsonldContext member in subscription is used when sending notifcations [Documentation] If a subscription has a jsonldContext member then it should be used when sending notifications [Tags] sub-notification 5_8_6 since_v1.7.1 ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification} ${headers}= Wait for notification timeout=${10} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] Check Notification Containing Entity Element ... ${entity_expectation_file_path} ... ${notification} *** Keywords *** Before Test Start Local Server ${notification_server_host} ${notification_server_port} Add Initial Entity Sleep 1s Setup Initial Subscription Add Initial Entity ${entity_id}= Generate Random Building Entity Id ${create_response}= Create Entity ${entity_building_filepath} ${entity_id} Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${entity_id} Setup Initial Subscription ${subscription_id}= Generate Random Subscription Id ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ... ${subscription_payload_file_path} ... ${subscription_id} ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} ${create_response}= Create Subscription From Subscription Payload ... ${subscription_payload} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response.status_code} Set Suite Variable ${subscription_id} After Test Delete Initial Subscription Delete Initial Entity Stop Local Server Delete Initial Subscription Delete Subscription ${subscription_id} Delete Initial Entity Delete Entity by Id ${entity_id}
data/subscriptions/expectations/compacted-entity-with-jsonldContext-046-20.jsonld 0 → 100644 +10 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Le Tour Eiffel", "datasetId": "urn:ngsi-ld:Dataset:french-name" }, "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" } No newline at end of file
data/subscriptions/subscription-building-with-invalid-jsonldContext.jsonld 0 → 100644 +20 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Subscription:randomUUID", "type": "Subscription", "entities": [ { "type": "Building" } ], "notification": { "format": "normalized", "endpoint": { "uri": "http://my.endpoint.org/notify", "accept": "application/ld+json" } }, "jsonldContext": "unknownContext", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } No newline at end of file
data/subscriptions/subscription-building-with-jsonldContext.jsonld 0 → 100644 +20 −0 Original line number Diff line number Diff line { "id": "urn:ngsi-ld:Subscription:randomUUID", "type": "Subscription", "entities": [ { "type": "Building" } ], "notification": { "format": "normalized", "endpoint": { "uri": "http://my.endpoint.org/notify", "accept": "application/ld+json" } }, "jsonldContext": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } No newline at end of file