Commit 29fddedf authored by Ken Zangelin's avatar Ken Zangelin
Browse files

fix: read CSR id from 'id', not '@id', in CsourceNotification data items

The CsourceNotification (clause 5.3.2) is delivered using the
Content-Type negotiated by the subscription's notification.endpoint.accept.
The CSR-subscription tests use accept=application/json (NGSI-LD
compact form), in which CSR identifiers are exposed under the JSON
member 'id'. The '@id' form only appears when the notification is
serialized as raw JSON-LD (application/ld+json).

'Wait for notification and validate it' was reading data[i][@id]
unconditionally, so every CSR-subscription notification test (047_*)
that got past the type/notifiedAt checks failed at this assertion
even when the broker sent the spec-compliant payload.

Read the field as 'id', matching the accept value the tests configure.
parent 22e7dfbb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ Wait for notification and validate it
    FOR    ${expected_context_source_registration_id}    IN    @{expected_context_source_registration_ids}
        List Should Contain Value
        ...    ${expected_context_source_registration_ids}
        ...    ${notification}[data][${index}][@id]
        ...    ${notification}[data][${index}][id]
        ${index}=    Evaluate    ${index} + 1
    END
    Should Be Equal    '${notification_data_length}'    '${expected_notification_data_length}'