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

fix: dedicated with-@context stub fixtures for D011 inclusive/redirect query-back

The D011 _inc/_red query tests serve their CP stub reply from
vehicle-simple-attributes(.|-second.)json — fixtures shared with ~70 tests as
REQUEST bodies (json + Link header), so @context cannot be embedded there
(body @context + Link = 400). A forwarded NGSI-LD response must carry its own
@context (§ 6.3.5); without it the broker correctly core-expands the CP's attrs
to the wrong IRIs and drops them on merge.

Add dedicated stub fixtures vehicle-simple-attributes-with-context.json and
vehicle-simple-attributes-second-with-context.json (copies + @context) and point
ONLY the stub-reply loads (Load Entity As Serialized Array) at them, leaving the
shared request-body fixtures untouched. Fixes the remaining 10 D011 _inc/_red
regressions. DistributedOperations subtree now 12 fails / 0 unclear — back to the
pre-ae2b7ea baseline (the 12 are genuine pre-existing doubts). Broker untouched;
ae2b7ea (correct) retained.
parent 388c6ca5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ D011_01_01_inc Query The Context Broker With Type
    [Documentation]    Check that if one queries the Context Broker for type, entity with matching type on a Context
    ...    Source gets returned
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_7_2
    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_payload_filename}    ${entity_id}
    ${serialized_entity}=    Load Entity As Serialized Array    vehicle-simple-attributes-with-context.json    ${entity_id}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?type=Vehicle    200    ${serialized_entity}

    ${response}=    Query Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ D011_01_03_inc Query The Context Broker With Type And Attribute
    [Documentation]    Check that if one queries for attribute present in an entity on a Context Source, only that
    ...    entity gets returned
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_7_2
    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_payload_filename2}    ${second_entity_id}
    ${serialized_entity}=    Load Entity As Serialized Array    vehicle-simple-attributes-second-with-context.json    ${second_entity_id}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?pick=isParked2&type=Vehicle    200    ${serialized_entity}

    ${response}=    Query Entities    entity_types=Vehicle    attrs=isParked2    context=${ngsild_test_suite_context}
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ D011_01_05_inc Query The Context Broker With Type
    [Documentation]    Check that entities on the Context Broker and Context Source with the same id get merged and
    ...    returned as one entity
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_7_2
    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_payload_filename}    ${entity_id}
    ${serialized_entity}=    Load Entity As Serialized Array    vehicle-simple-attributes-with-context.json    ${entity_id}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?type=Vehicle    200    ${serialized_entity}

    ${response}=    Query Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ D011_01_red Query The Context Broker With Type
    [Documentation]    Check that if one queries the Context Broker for type, entity with matching type on a Context
    ...    Source gets returned
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxy-redirect    4_3_6_3    5_7_2
    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_payload_filename}    ${entity_id}
    ${serialized_entity}=    Load Entity As Serialized Array    vehicle-simple-attributes-with-context.json    ${entity_id}
    Set Stub Reply    GET    /broker1/ngsi-ld/v1/entities?type=Vehicle    200    ${serialized_entity}

    ${response}=    Query Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ Setup Registration And Context Source Mock Server And Query The Context Broker W

    Start Context Source Mock Server

    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_payload_filename}    ${entity_id}
    ${serialized_entity}=    Load Entity As Serialized Array    vehicle-simple-attributes-with-context.json    ${entity_id}
    Set Stub Reply    ${method}    ${url}    200    ${serialized_entity}

    IF    '${method}' == 'GET'
Loading