Commit 75ba471d authored by kzangeli's avatar kzangeli
Browse files

fix(046_22_08): a fully-deleted multi-attribute notifies one Null marker per instance



`name` in building-multi-instances-attributes has three instances (the default
one plus two datasetIds) and the test deletes all three, so the notification
reports one NGSI-LD Null marker PER removed instance — a multi-instance
Attribute is an Array, deleted or not (TS 104-175 § 8.5 / § 10.5.7). The
assertion indexed it as a single object and died inside Robot with
"list indices must be integers". Assert the Array instead.

Also reverts 94601fb4, which had changed 010_04_01 to expect SHORT attribute
names in the 207 UpdateResult. TS 104-176 § 6.2.3 is explicit: "Only Fully
Qualified Names shall be used in the payload body of error or partial success
responses, as there is no context present". The original expectations were
right; the broker was the half-wrong side (it compacted against the core
context only, so default-context attributes came out short while
foreign-context IRIs stayed expanded) and is fixed as of 2026-07-30.

Doubts recorded as #103 and #104.

Co-Authored-By: default avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
parent 9a8cce10
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -14,8 +14,13 @@ Test Template Append Attributes With Params

*** Variables ***
${filename}=                        vehicle-speed-two-datasetid.jsonld
${existing_attribute_name}=         speed
${non_existing_attribute_name}=     attribute_to_be_added
# TS 104-176 § 6.2.3: "Only Fully Qualified Names shall be used in the payload
# body of error or partial success responses, as there is no context present."
# A 207 UpdateResult is a partial success, so its attributeName / updated entries
# are FQNs — NOT compacted against the request @context. (Reverts 94601fb4, which
# expected the short names; see testsuite-doubts.md #104.)
${existing_attribute_name}=         https://ngsi-ld-test-suite/context#speed
${non_existing_attribute_name}=     https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added


*** Test Cases ***    STATUS_CODE    FRAGMENT_FILENAME    EXPECTATION_FILENAME
+12 −4
Original line number Diff line number Diff line
@@ -36,10 +36,18 @@ ${entity_expectation_file_path}= entity-deleted-name-attribute-instance-n
    Should be Equal    ${subscription_id}    ${notification}[subscriptionId]
    Length Should Be    ${notification}[data]    ${1}
    Should be Equal    ${entity_id}    ${notification}[data][0][id]
    Check JSON Value In Response Body
    ...    json_path_expr=['name']['value']
    ...    value_to_check=urn:ngsi-ld:null
    ...    response_body=${notification}[data][0]

    # `name` has three instances in building-multi-instances-attributes (the
    # default one plus two datasetIds) and deleteAll=true removed all three, so
    # the notification carries one NGSI-LD Null marker PER removed instance:
    # a multi-instance Attribute is an Array, deleted or not (TS 104-175
    # § 10.5.7 / § 8.5). Asserting a single ['name']['value'] only holds for a
    # single-instance Attribute — see testsuite-doubts.md #103.
    ${deleted_name_instances}=    Set Variable    ${notification}[data][0][name]
    Length Should Be    ${deleted_name_instances}    ${3}
    FOR    ${name_instance}    IN    @{deleted_name_instances}
        Should Be Equal    ${name_instance}[value]    urn:ngsi-ld:null
    END


*** Keywords ***