Commit 4df70445 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: use a wildcard Accept header to avoid default application/json added by the lib

parent 92d30505
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ ${content_type}= application/json
    ${request}    ${response}=    Create Entity Selecting Content Type  ${building_filename}     ${id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=    Query Entity    ${id}    context=${ngsild_test_suite_context}
    ${request}    ${response}=    Query Entity    ${id}    context=${ngsild_test_suite_context}     accept=*/*
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing Entity element    ${building_expectation}    ${id}    ${response['body']}
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
@@ -50,7 +50,7 @@ ${content_type}= application/json
    ${response}=    Create Subscription    ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=  Retrieve Subscription  ${id}
    ${request}    ${response}=  Retrieve Subscription  ${id}     accept=*/*
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing One Subscription element    ${subscription_expectation}    ${response['body']}
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
@@ -68,7 +68,7 @@ ${content_type}= application/json
    ${request}    ${response}=    Create Context Source Registration With Return  ${updated_payload}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=  Query Context Source Registrations With Return      id=${registration_id}    type=${registration_type}    context=${ngsild_test_suite_context}
    ${request}    ${response}=  Query Context Source Registrations With Return      id=${registration_id}    type=${registration_type}    context=${ngsild_test_suite_context}     accept=*/*
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing One Registration element  ${registration_expectation}    ${response['body']}
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
@@ -82,8 +82,9 @@ ${content_type}= application/json
    
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${tea_id_prefix}
    Create Temporal Representation Of Entity  ${tea_filename}     ${temporal_entity_representation_id}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=  Query Temporal Representation Of Entities With Return   entity_types=${teatype}    timerel=after    timeAt=2020-08-01T12:05:00Z    context=${ngsild_test_suite_context}
    ${request}    ${response}=  Query Temporal Representation Of Entities With Return   entity_types=${teatype}    timerel=after    timeAt=2020-08-01T12:05:00Z    context=${ngsild_test_suite_context}     accept=*/*
    Check Response Status Code  200    ${response['status']}
    Set Test Variable  ${response}
    Check Response Body Containing EntityTemporal element      ${tea_expectation}    ${temporal_entity_representation_id}
+2 −2
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ Query Context Source Registrations
    &{headers}=  Create Dictionary
    &{params}=  Create Dictionary
    Run Keyword If     '${context}'!=''       Set To Dictionary   ${headers}    Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json"
    Run Keyword If     '${accept}'!=''       Set To Dictionary   ${headers}    accept=${accept}
    Run Keyword If     '${accept}'!=''       Set To Dictionary   ${headers}    Accept=${accept}
    Run Keyword If     '${id}'!=''       Set To Dictionary   ${params}    id=${id}
    Run Keyword If     '${type}'!=''       Set To Dictionary   ${params}    type=${type}
    Run Keyword If     '${attrs}'!=''       Set To Dictionary   ${params}    attrs=${attrs}
@@ -824,7 +824,7 @@ Query Context Source Registrations With Return
    &{headers}=  Create Dictionary
    &{params}=  Create Dictionary
    Run Keyword If     '${context}'!=''       Set To Dictionary   ${headers}    Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json"
    Run Keyword If     '${accept}'!=''       Set To Dictionary   ${headers}    accept=${accept}
    Run Keyword If     '${accept}'!=''       Set To Dictionary   ${headers}    Accept   ${accept}
    Run Keyword If     '${id}'!=''       Set To Dictionary   ${params}    id=${id}
    Run Keyword If     '${type}'!=''       Set To Dictionary   ${params}    type=${type}
    Run Keyword If     '${attrs}'!=''       Set To Dictionary   ${params}    attrs=${attrs}