Commit 954a7e51 authored by kzangeli's avatar kzangeli
Browse files

fix: lowercase boolean URL params (local=true, deleteAll=true)



NGSI-LD § 4 (URL parameter conventions) and RFC 3986 § 6.2.2.1 both
specify that URL parameter values are case-sensitive. The spec uses
the literal lowercase tokens `true` and `false` throughout.

Nine call sites across eight tests passed `local=${True}` (or
`${true}`) — Robot Framework's `${True}`/`${true}` is Python's
`True`, which the requests library serializes as the string
"True" (capital T) in URL parameters. Plus one `deleteAll=${true}`
in 046_22_08. Brokers that strictly enforce the spec's case-
sensitive convention correctly reject this as 400 BadRequestData;
the affected tests were never reaching their intended assertions.

Replaced all nine occurrences with the literal lowercase `true`.

Affected tests:
  - 046_22_08              (deleteAll=true on DELETE attrs)
  - D010_01_exc, D010_02_exc, D010_02_red
  - D002_01_exc, D002_02_exc
  - D003_02_exc, D004_01_exc

Verified on swBroker: D010_02_red, D010_02_exc, D002_01_exc, and
046_22_08 now pass cleanly. The remaining four tests still fail —
but at strictly later errors (stub-call counts, mock-server
timeouts, unexpected 204s) rather than the parseBool 400, exposing
unrelated test-side or broker-logic issues that the case-sensitivity
rejection had been masking. Those will be addressed independently.

Co-Authored-By: default avatarClaude Opus 4.7 <noreply@anthropic.com>
parent 1bf56638
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ ${entity_expectation_file_path}= entity-deleted-name-attribute-instance-n
    ...    entityId=${entity_id}
    ...    attributeId=name
    ...    datasetId=${EMPTY}
    ...    deleteAll=${true}
    ...    deleteAll=true
    ...    context=${ngsild_test_suite_context}
    Check Response Status Code    204    ${response.status_code}

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
        ${entity_id}=    Generate Random Vehicle Entity Id
        Set Suite Variable   ${entity_id}

        ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=${True}
        ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=true
        Check Response Status Code    201    ${response.status_code}

        ${registration_id}=    Generate Random CSR Id
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ D010_02_exc Query Context Broker And Retrieve Entity By Id
    ${entity_speed}=    Load Entity    ${entity_speed_filename}    ${entity_id}
    Set Stub Reply    GET    /broker1/ngsi-ld/v1/entities/${entity_id}    200    ${entity_speed}

    ${response}=    Retrieve Entity    ${entity_id}    context=${ngsild_test_suite_context}    local=${True}
    ${response}=    Retrieve Entity    ${entity_id}    context=${ngsild_test_suite_context}    local=true
    Dictionary Should Not Contain Key    ${response.json()}    speed
    
*** Keywords ***
@@ -36,7 +36,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
        ${entity_id}=    Generate Random Vehicle Entity Id
        Set Suite Variable   ${entity_id}

        ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=${True}
        ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=true
        Check Response Status Code    201    ${response.status_code}

        ${registration_id}=    Generate Random CSR Id
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ D010_02_red Query Context Broker And Retrieve Entity By Id
    ${response}=    Retrieve Entity
    ...    ${entity_id}
    ...    context=${ngsild_test_suite_context}
    ...    local=${true}
    ...    local=true
    Check Response Status Code    404    ${response.status_code}

    ${stub_count}=    Get Stub Count    GET    /broker1/ngsi-ld/v1/entities/${entity_id}
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
    ${entity_id}=    Generate Random Vehicle Entity Id
    Set Suite Variable    ${entity_id}

    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=${True}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=true
    Check Response Status Code    201    ${response.status_code}

    ${registration_id}=    Generate Random CSR Id
Loading