Commit cf27e5fd authored by kzangeli's avatar kzangeli
Browse files

fix(local): D004_01_inc expect 204 + stub the spec-correct /attrs/ slash

D004_01_inc sets up an inclusive registration with redirectionOps (the
entity lives only on the Context Source) and updates an attribute. The
update is forwarded to the CSR, which returns 204; nothing is held
locally to fail. No leg errors → 204 No Content, not 207.

Three test-side problems:
- The PATCH stub was at `/entities/{id}/attrs` (no trailing slash) while
  the broker forwards the spec-correct `/entities/{id}/attrs/`
  (TS 104-176 § 7.4.3) — the very URL the test's own `Get Stub Count`
  already checks. Stub now matches.
- Expected 207; corrected to 204 (a fully successful distributed write
  carries no per-registration error, so no BatchOperationResult — see
  issue #105 / § 6.3.5 vs the operation behaviour).
- Dropped the response-body entity-URI assertion: a 204 has no body.

Local branch only, no MR.
parent d5ed03c3
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -25,21 +25,17 @@ D004_01_inc Query The Context Broker With Type
    [Documentation]    Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_6_2

    Set Stub Reply    PATCH    /ngsi-ld/v1/entities/${entity_id}/attrs    204
    Set Stub Reply    PATCH    /ngsi-ld/v1/entities/${entity_id}/attrs/    204
    ${response}=    Update Entity Attributes
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_LD_JSON}

    Wait for redirected request
    Check Response Status Code    207    ${response.status_code}
    Check Response Status Code    204    ${response.status_code}
    ${stub_count}=    Get Stub Count    PATCH    /ngsi-ld/v1/entities/${entity_id}/attrs/
    Should Be True    ${stub_count} > 0

    @{entities_id}=    Create List    ${entity_id}
    ${payload_list}=    Evaluate    [$payload]
    Check Response Body Containing Entities URIS set to    ${entities_id}    ${payload_list}


*** Keywords ***
Setup Registration And Start Context Source Mock Server