Commit 9d5d5957 authored by kzangeli's avatar kzangeli
Browse files

fix(047): align the csub-notification tests with TS 104-175 clause 12.4.7

Clause 12.4.7: the initial csource notification is sent UNCONDITIONALLY
on subscription (with an empty data array when no CSR matches), and
periodic (timeInterval) notifications fire regardless of changes. The
047 family assumed no notification arrives when nothing matches:

- every setup that creates the subscription before (or without) a
  matching CSR now consumes the initial notification, so later waits
  see the intended one (047_03/04/05/07/08/09/10..16)
- 047_02/04/08/09 paired the Building-watching subscription with the
  Vehicle+OffStreetParking CSR — per 12.4.7 these do NOT match; they
  now use the Building-and-Bus CSR (as 047_03 already did). The
  endpoint-update (still matching → "updated") and
  information-replacing ("noLongerMatching") fragments work unchanged
- 047_05 verifies the success bookkeeping on the initial notification
  itself; the non-matching CSR creation must then trigger nothing
- 047_06's expectation gains timesFailed (clause 12.4.7 failure
  bookkeeping)
- Update CSR Subscription keyword: optional context arg → Link header;
  047_16's selector patch needs the test-suite @context or 'Vehicle'
  expands against the default context and matches nothing
- NotificationUtils validator: entityInfo type can be a string or an
  array — indexing [0] into a string yields its first character
  ('Building' != 'B')
parent d9a20233
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Test Teardown Delete Created Context Source Registration And Context Sourc


*** Variables ***
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration.jsonld
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration-building-and-bus-entities.jsonld
${subscription_payload_file_path}=                      csourceSubscriptions/subscription.jsonld
${update_fragment_file_path}=                           csourceRegistrations/fragments/context-source-registration-update.json

+4 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@ Setup Initial Context Source Registration Subscription
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    Set Suite Variable    ${subscription_id}
    # TS 104-175 clause 12.4.7: the initial csource notification is sent
    # unconditionally on subscription — with no matching CSR yet it carries
    # an empty data array. Consume it so later waits see the right one.
    Wait for notification

Delete Created Context Source Registration And Subscription
    Stop Local Server
+5 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Test Teardown Delete Created Context Source Registration And Subscription


*** Variables ***
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration.jsonld
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration-building-and-bus-entities.jsonld
${subscription_payload_file_path}=                      csourceSubscriptions/subscription.jsonld


@@ -44,6 +44,10 @@ Setup Initial Context Source Registration Subscription
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    Set Suite Variable    ${subscription_id}
    # TS 104-175 clause 12.4.7: the initial csource notification is sent
    # unconditionally on subscription — with no matching CSR yet it carries
    # an empty data array. Consume it so later waits see the right one.
    Wait for notification

Delete Created Context Source Registration And Subscription
    Stop Local Server
+6 −1
Original line number Diff line number Diff line
@@ -27,8 +27,13 @@ ${notification_expectation_file_path}= notifications/expectatio
    ...    ${context_source_registration_payload_file_path}
    ...    ${context_source_registration_id}
    Set Suite Variable    ${context_source_registration_id}
    ${create_response}=    Create Context Source Registration    ${context_source_registration_payload}
    # TS 104-175 clause 12.4.7: the initial csource notification (sent
    # unconditionally on subscription) is the successful delivery whose
    # bookkeeping this test verifies. The CSR created above does not match
    # the subscription's entities, so no further notification may arrive.
    Wait for notification
    ${create_response}=    Create Context Source Registration    ${context_source_registration_payload}
    Wait for no notification
    ${response}=    Retrieve Context Source Registration Subscription
    ...    subscription_id=${subscription_id}
    @{expected_notification_additional_members}=    Create List    lastNotification    lastSuccess
+4 −0
Original line number Diff line number Diff line
@@ -52,6 +52,10 @@ Setup Initial Context Source Registration Subscription
    ...    ${subscription_id}
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    # TS 104-175 clause 12.4.7: the subscription is created active, so the
    # unconditional initial csource notification arrives before the pause —
    # consume it so "Wait for no notification" only sees post-pause traffic.
    Wait for notification
    Set Suite Variable    ${subscription_id}

Delete Created Context Source Registration And Subscription
Loading