Commit d20cf3dc authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: missing contexts in 015_03 and 017_01

parent d5ac040c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId
Documentation   Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource
@@ -25,7 +25,7 @@ Delete Attribute
    ${response}=  Create Or Update Temporal Representation Of Entity Selecting Content Type  ${valid_temporal_entity_id}    ${filename}     ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=  Delete Attribute From Temporal Entity  ${entity_id}    ${attribute_id}     ${CONTENT_TYPE_LD_JSON}    ${EMPTY}    false
    ${response}=  Delete Attribute From Temporal Entity  ${entity_id}    ${attribute_id}     ${CONTENT_TYPE_JSON}    ${EMPTY}    false      ${ngsild_test_suite_context}
    Check Response Status Code   ${status_code}    ${response['status']}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to      ${response}     ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
+2 −2
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei
    ${response}=  Create Or Update Temporal Representation Of Entity Selecting Content Type  ${temporal_entity_representation_id}    ${filename}     ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=  Get Temporal Representation Of Entity  ${temporal_entity_representation_id}    ${CONTENT_TYPE_LD_JSON}    sysAttrs
    ${response}=  Get Temporal Representation Of Entity  ${temporal_entity_representation_id}    ${CONTENT_TYPE_LD_JSON}    sysAttrs    ${ngsild_test_suite_context}
    ${instanceId}=  Set Variable  ${response['body']['speed'][0]['instanceId']}

    ${response}=  Delete Attribute Instance From Temporal Entity  ${temporal_entity_representation_id}    ${attributeId}    ${instanceId}    ${CONTENT_TYPE_LD_JSON}
    ${response}=  Delete Attribute Instance From Temporal Entity  ${temporal_entity_representation_id}    ${attributeId}    ${instanceId}    ${CONTENT_TYPE_JSON}   ${ngsild_test_suite_context}
    Check Response Status Code  204    ${response['status']}

    ${temporal_entity_expectation_payload}=    Load Test Sample   temporalEntities/expectations/${expectation_filename}    ${temporal_entity_representation_id}
+6 −3
Original line number Diff line number Diff line
@@ -381,11 +381,12 @@ Delete Several Temporal Representations Of Entities
    END

Get Temporal Representation Of Entity
    [Arguments]  ${temporal_entity_representation_id}    ${accept}=${EMPTY}    ${options}=${EMPTY}
    [Arguments]  ${temporal_entity_representation_id}    ${accept}=${EMPTY}    ${options}=${EMPTY}      ${context}=${EMPTY}
    &{headers}=  Create Dictionary
    &{params}=  Create Dictionary
    ${options_length} =  Get Length  ${options}
    Run Keyword If     '${accept}'!=''       Set To Dictionary   ${headers}   Accept    ${accept}
    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     ${options_length}>0       Set To Dictionary   ${params}       options=${options}
    ${response}=  GET  ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}      headers=${headers}    query=${params}
    Output  request
@@ -393,8 +394,10 @@ Get Temporal Representation Of Entity
    [return]  ${response}

Delete Attribute Instance From Temporal Entity
    [Arguments]  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${content_type}
    ${response}=  DELETE  ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId}
    [Arguments]  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${content_type}    ${context}=${EMPTY}
    &{headers}=  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"
    ${response}=  DELETE  ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId}      headers=${headers}
    Output  request
    Output  response
    [return]  ${response}