Newer
Older
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"
lopezaguilar
committed
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
Resource ${EXECDIR}/resources/MockServerUtils.resource
Suite Setup Before Test
Suite Teardown After Test
*** Variables ***
${subscription_id_prefix}= urn:ngsi-ld:Subscription:
${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld
${building_id_prefix}= urn:ngsi-ld:Building:
${entity_building_filepath}= building-simple-attributes-sample.jsonld
${fragment_filename}= airQualityLevel-fragment.jsonld
*** Test Cases ***
046_13_01 Check that lastFailure and status are updated if a notification could not be sent
[Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed"
@{expected_notification_data_entities}= Create List Building
Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON}
... accept=${CONTENT_TYPE_LD_JSON}
... context=${ngsild_test_suite_context}
${notification_info}= Get Value From Json ${response.json()} $.notification
Dictionary Should Contain Key ${notification_info}[0] status
Should be Equal failed ${notification_info}[0][status]
Dictionary Should Contain Key ${notification_info}[0] lastFailure
lopezaguilar
committed
${last_failure_date}= Parse Ngsild Date ${notification_info}[0][lastFailure]
Should Not Be Equal ${last_failure_date} ${None}
*** Keywords ***
Setup Initial Subscription
${subscription_id}= Generate Random Entity Id ${subscription_id_prefix}
Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON}
Benoit Orihuela
committed
Delete Initial Subscription
Delete Subscription ${subscription_id}
${entity_id}= Generate Random Entity Id ${building_id_prefix}
Create Entity ${entity_building_filepath} ${entity_id}
Set Suite Variable ${entity_id}
Delete Initial Entity
Delete Entity by Id ${entity_id}
Before Test
Setup Initial Subscription
Add Initial Entity
After Test
Delete Initial Subscription
Delete Initial Entity