Commit 5fd288d3 authored by kzangeli's avatar kzangeli Committed by Ken Zangelin
Browse files

fix(jsonldContext): suite-scoped ${uri} + unknown-id deletes are 404

Three suites (051_05, 053_05, 053_06) share the file-level variable
${uri} = /api/v1/context.jsonld and their setups Catenate the context
server's host:port onto it, then Set GLOBAL Variable. In a full run the
first suite publishes the absolute URL globally and the next suite's
Catenate doubles it (http://0.0.0.0:8087http//0.0.0.0:8087/...) — every
follow-up request 404s. 051_05's Catenate was even commented out,
silently relying on whatever absolute URL another suite left behind.
Each suite now catenates its own copy and uses Set Suite Variable.

051_04_01 (wrong id + reload=true) expected 400; clause 13.5.4 mandates
ResourceNotFound for an identifier that 'does not correspond to any
existing entry' — the reload bullets only describe behaviour for an
existing @context. Corrected to 404.

The 051_05/053_05 LdContextNotAvailable 503→504 expectations are
re-declared identically to their origin branch (unmerged MR) — git
deduplicates on merge.
parent e0dd3948
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -56,7 +56,10 @@ Create Initial @context condition from an external server
    Start @context Local Server

    ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    Set Global Variable    ${uri}
    # Suite scope, NOT global — a global ${uri} bleeds into the other
    # jsonldContext suites sharing the same variable name, and their own
    # Catenate then doubles the URL.
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}

@@ -71,7 +74,7 @@ Create Initial @context condition from an external server
    Stop @context Local Server

    ${response}=    Delete a @context    ${uri}    true
    Check Response Status Code    503    ${response.status_code}
    Check Response Status Code    504    ${response.status_code}

Delete Initial @context condition from an external server
    Log    Delete initial contidions
+2 −1
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ Create Initial @context condition from an external server
    Set Global Variable    ${first_existing_entity_id}

    ${uri}=    Catenate    SEPARATOR=    http://${context_server_host}:${context_server_port}    ${uri}
    Set Global Variable    ${uri}
    # Suite scope, NOT global.
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}    ${first_existing_entity_id}
    ${response}=    Serve a @context
+4 −1
Original line number Diff line number Diff line
@@ -21,7 +21,10 @@ ${reason_422}= Unprocessable
*** Test Cases ***    CONTEXTID    RELOAD    STATUSCODE    REASON    ERROR
051_04_01 Delete A @contexts With A Wrong Id And Reload Set To True
    [Tags]    ctx-delete    5_13_5    since_v1.5.1
    wrong_id_context    true    400    ${reason_400}    ${ERROR_TYPE_BAD_REQUEST_DATA}
    # An identifier that "does not correspond to any existing entry" is
    # ResourceNotFound (clause 13.5.4) — reload only enters the picture for
    # an EXISTING @context.
    wrong_id_context    true    404    ${reason_404}    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
051_04_02 Delete A @contexts With A Wrong Id And Reload Set To False
    [Tags]    ctx-delete    5_13_5    since_v1.5.1
    wrong_id_context    false    404    ${reason_404}    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
+7 −4
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ ${uri} /api/v1/context.jsonld

    ${response}=    Delete a @context    ${uri}    true

    Check Response Status Code    503    ${response.status_code}
    Check Response Reason set to    ${response.reason}    Service Unavailable
    Check Response Status Code    504    ${response.status_code}
    Check Response Reason set to    ${response.reason}    Gateway Timeout
    Check Response Body Containing ProblemDetails Element
    ...    ${response.json()}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
@@ -42,8 +42,11 @@ ${uri} /api/v1/context.jsonld
Create Initial @context condition from an external server
    Start @context Local Server

    # ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    Set Global Variable    ${uri}
    ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    # Suite scope, NOT global — with the Catenate above commented out this
    # suite silently depended on the absolute URL another suite happened to
    # leave in the global ${uri}.
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}