Commit c4cdb0cf authored by kzangeli's avatar kzangeli
Browse files

fix(local): 041_03 request ld+json so @context isn't folded into the Link header

The page= -> offset= flip was already applied, but 041_03_01/02 still failed
on a different cause: the query was sent without an Accept header (-> the
response is application/json), so the broker correctly carries the @context as
an extra value in the Link header alongside prev/next (several Link values fold
into one comma-separated header per RFC 8288 § 3). Check Pagination Prev And
Next Headers (AssertionUtils.resource) compares the WHOLE Link header against
just prev/next, so the @context value broke it (3 != 2 / whole-header mismatch).

Pass accept=ld+json so the @context goes in the body and the Link header is
pure pagination, matching the sibling tests 031_02 / 037_11. Broker behaviour
is correct; this is a test-side fix. See forge issue #114.
parent a1c606fd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -33,10 +33,14 @@ ${third_subscription_payload_file_path}= csourceSubscriptions/subscriptio
Query Context Source Registration Subscriptions With Limit And Offset Parameters
    [Documentation]    Check that one can query context source registration subscriptions with providing offset and limit parameters for pagination
    [Arguments]    ${limit}    ${offset}    ${expected_subscription_number}    ${prev_link}    ${next_link}
    # accept=ld+json: the pagination keyword compares the WHOLE Link header,
    # so the @context must be carried in the body (ld+json), not as an extra
    # Link value. Matches the sibling tests 031_02 / 037_11.
    ${response}=    Query Context Source Registration Subscriptions
    ...    context=${ngsild_test_suite_context}
    ...    limit=${limit}
    ...    offset=${offset}
    ...    accept=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing Number Of Entities
    ...    Subscription