Commit c8253a1a authored by kzangeli's avatar kzangeli
Browse files

Merge branch 'fix/d011-family' into integration/all-fixes

# Conflicts:
#	TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot
parents 6510fb0c 9fcad4fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ D011_01_02_inc Query The Context Broker With Type And Missing Attribute
    ...    Contrast with D011_01_04, where a local entity also exists but also lacks the queried attribute.
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_7_2
    ${empty_response}=    Create Empty Array Result
    Set Stub Reply    GET    /ngsi-ld/v1/entities?attrs=speed&type=Vehicle    200    ${empty_response}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?pick=speed&type=Vehicle    200    ${empty_response}

    ${response}=    Query Entities    entity_types=Vehicle    attrs=speed    context=${ngsild_test_suite_context}

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ D011_01_03_inc Query The Context Broker With Type And Attribute
    ...    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}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?attrs=isParked2&type=Vehicle    200    ${serialized_entity}
    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_04_inc Query The Context Broker With Type And Attribute In Neither
    ...    returned. Contrast with D011_01_02, where no local entity exists at all.
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_7_2
    ${empty_response}=    Create Empty Array Result
    Set Stub Reply    GET    /ngsi-ld/v1/entities?attrs=speed&type=Vehicle    200    ${empty_response}
    Set Stub Reply    GET    /ngsi-ld/v1/entities?pick=speed&type=Vehicle    200    ${empty_response}

    ${response}=    Query Entities    entity_types=Vehicle    attrs=speed    context=${ngsild_test_suite_context}

+2 −2
Original line number Diff line number Diff line
@@ -30,14 +30,14 @@ D011_01_exc Query The Context Broker With Type
    ${serialized_entity}=    Load Entity As Serialized Array    ${entity_speed_filename}    ${entity_id}
    Set Stub Reply
    ...    GET
    ...    /broker1/ngsi-ld/v1/entities?type=Vehicle&id=${entity_id}&attrs=speed
    ...    /broker1/ngsi-ld/v1/entities?type=Vehicle&id=${entity_id}&pick=speed
    ...    200
    ...    ${serialized_entity}

    ${response}=    Query Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}

    ${stub_count}=    Get Stub Count    GET    /broker1/ngsi-ld/v1/entities?type=Vehicle&id=${entity_id}&attrs=speed
    ${stub_count}=    Get Stub Count    GET    /broker1/ngsi-ld/v1/entities?type=Vehicle&id=${entity_id}&pick=speed
    Should Be True    ${stub_count} > 0

    Should Have Value In Json    ${response.json()[0]}    $.speed
+10 −6
Original line number Diff line number Diff line
@@ -46,12 +46,21 @@ Setup Registration And Context Source Mock Server And Query The Context Broker W

    ${registration_id}=    Generate Random CSR Id
    Set Suite Variable    ${registration_id}
    # The fixture's redirectionOps group does NOT include queryBatch
    # (TS 104-175 Table 9.2-2) — restrict to the operation under test so
    # the broker picks the matching forward form.
    IF    '${method}' == 'POST'
        ${operations}=    Create List    queryBatch
    ELSE
        ${operations}=    Create List    queryEntity
    END
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id=${entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ...    operations=${operations}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Start Context Source Mock Server
@@ -60,12 +69,7 @@ Setup Registration And Context Source Mock Server And Query The Context Broker W
    @{entities_id}=    Create List    ${entity_id}

    IF    '${method}' == 'GET'
        # Broker forwards with `pick=…` (spec § 5: `attrs` is deprecated and
        # is a synonym for `pick` + `q`). HttpCtrl's stub matcher substring-
        # checks each stub-param name+value against the criteria query
        # string, so the stub must use the canonical `pick=`. See
        # testsuite-doubts.md #22.
        Set Stub Reply    ${method}    ${url}?type=Vehicle&pick=speed    200    ${serialized_entity}
        Set Stub Reply    ${method}    ${url}?type=Vehicle&id=${entity_id}&pick=speed    200    ${serialized_entity}
        ${response2}=    Query Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
    ELSE IF    '${method}' == 'POST'
        Set Stub Reply    ${method}    ${url}    200    ${serialized_entity}
Loading