Commit eb289c17 authored by kzangeli's avatar kzangeli
Browse files

fix(local): D016_01_inc assert the speed key per merged entity, not list membership

The final check was `Should Contain ${response.json()} speed`, but
response.json() is a LIST of entity objects, so Should Contain does list
MEMBERSHIP — it asks whether the string 'speed' is an element of the list,
which it never is (the elements are entity dicts). The test failed with
"... does not contain 'speed'" even though both returned entities carry speed.

The broker's inclusive merge is correct: the query returns both entities, each
with the local brandName preserved AND the merged speed (value 56, with source
and datasetId) and the updated isParked2.

Mirror the sibling D016_01_red: assert the response is non-empty, then check
each entity dict contains the speed key.
parent 4fa42769
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -43,7 +43,13 @@ D016_01_inc Merge Batch Entities On Both Context Broker And Context Source
    ...    context=${ngsild_test_suite_context}
    ...    accept=${CONTENT_TYPE_LD_JSON}
    
    Should Contain    ${response.json()}    speed
    # response.json() is a LIST of entities — Should Contain would do list
    # membership ('speed' is not an element), not a key check. Assert each
    # merged entity carries the speed key (as in the sibling D016_01_red).
    Should Not Be Empty    ${response.json()}
    FOR    ${entity}    IN    @{response.json()}
        Dictionary Should Contain Key    ${entity}    speed
    END

*** Keywords ***
Create Entity And Registration On The Context Broker And Start Context Source Mock Server