Commit a5671340 authored by lopezaguilar's avatar lopezaguilar
Browse files

First iteration to the resolution of the notification test suites

parent 1f35e8d7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


*** Test Cases ***
043_01 Create entity
043_01_01 Create entity
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)
    [Tags]    e-create    5_2_2
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
@@ -34,7 +34,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Entity by Id    ${entity_id}

043_02 Create subscription
043_01_02 Create subscription
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription)
    [Tags]    sub-create    5_2_2
    ${subscription_id}=    Generate Random Entity Id    ${subscription_id_prefix}
@@ -46,7 +46,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Subscription    ${subscription_id}

043_03 Create Temporal Representation of Entities
043_01_03 Create Temporal Representation of Entities
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)
    [Tags]    te-create    5_2_2
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${tea_id_prefix}
@@ -61,7 +61,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}

043_04 Batch entity create
043_01_04 Batch entity create
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create)
    [Tags]    be-create    5_2_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
@@ -78,7 +78,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Batch Delete Entities    entities_ids_to_be_deleted=@{entities_ids_to_be_created}

043_05 Create context source registration
043_01_05 Create context source registration
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration)
    [Tags]    csr-create    5_2_2
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
+5 −6
Original line number Diff line number Diff line
@@ -23,12 +23,6 @@ ${notification_server_send_url}= http://${notification_server_host}:${not
046_01_01 Check that a notification is only sent if status is active
    [Documentation]    Check that a notification is only sent if and only if the status is active
    [Tags]    sub-notification    5_8_6    046_01

    Add Initial Entity
    Sleep    1s

    Setup Initial Subscriptions

    ${response}=    Update Entity Attributes    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}

    ${notification}    ${headers}=    Wait for notification    timeout=${10}
@@ -49,6 +43,11 @@ Setup Initial Subscriptions
    Create Subscription From Subscription Payload    ${subscription_payload}    ${CONTENT_TYPE_LD_JSON}
    Set Suite Variable    ${subscription_id}

    Add Initial Entity
    Sleep    1s

    Setup Initial Subscriptions

Delete Initial Subscriptions
    Delete Subscription    ${subscription_id}

+3 −4
Original line number Diff line number Diff line
@@ -22,10 +22,7 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld
046_02_01 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

    Add Initial Entity
    Sleep    1s
    Setup Initial Subscriptions
    ${response}=    Setup Initial Subscriptions

    ${notification}=    Wait for notification    timeout=${15}

@@ -50,6 +47,8 @@ Setup Initial Subscriptions
    ${subscription_payload}=    Set Entity Id In Subscription    ${subscription_payload}    ${entity_id}
    Create Subscription From Subscription Payload    ${subscription_payload}    ${CONTENT_TYPE_LD_JSON}
    Set Suite Variable    ${subscription_id}
    Add Initial Entity
    Sleep    1s

Delete Initial Subscriptions
    Delete Subscription    ${subscription_id}
+3 −4
Original line number Diff line number Diff line
@@ -22,10 +22,7 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld
046_03_01 Check that a notification is sent with all entities
    [Documentation]    A notification with all subscribed Entities will be included if query or geoquery are not defined.
    [Tags]    sub-notification    5_11_7    046_03

    Add Initial Entity
    Sleep    1s
    Setup Initial Subscriptions
    ${response}=    Setup Initial Subscriptions

    ${notification}=    Wait for notification    ${5}
    Should be Equal    ${subscription_id}    ${notification}[subscriptionId]
@@ -47,6 +44,8 @@ Setup Initial Subscriptions
    ${subscription_payload}=    Set Entity Id In Subscription    ${subscription_payload}    ${entity_id}
    Create Subscription From Subscription Payload    ${subscription_payload}    ${CONTENT_TYPE_LD_JSON}
    Set Suite Variable    ${subscription_id}
    Add Initial Entity
    Sleep    1s

Delete Initial Subscriptions
    Delete Subscription    ${subscription_id}
+4 −4
Original line number Diff line number Diff line
@@ -24,10 +24,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld
    [Documentation]    The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions
    [Tags]    sub-notification    5_11_7    046_04

    Add Initial Entity
    Sleep    1s
    Setup Initial Subscriptions
    Update Entity Attributes    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=    Update Entity Attributes    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}

    ${notification}=    Wait for notification    ${5}
    Should be Equal    ${subscription_id}    ${notification}[subscriptionId]
@@ -48,6 +45,9 @@ Setup Initial Subscriptions
    ${subscription_payload}=    Set Entity Id In Subscription    ${subscription_payload}    ${entity_id}
    Create Subscription From Subscription Payload    ${subscription_payload}    ${CONTENT_TYPE_LD_JSON}
    Set Suite Variable    ${subscription_id}
    Add Initial Entity
    Sleep    1s
    Setup Initial Subscriptions

Delete Initial Subscriptions
    Delete Subscription    ${subscription_id}
Loading