Commit 60256cf5 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: contexts and fragments in 016_XX

parent a87a2cca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,12 +21,12 @@ ${attributeId}= speed
    ${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}
    ${createdAt_before_update}=  Set Variable  ${response['body']['speed'][0]['createdAt']}
    ${modifiedAt_before_update}=  Set Variable  ${response['body']['speed'][0]['modifiedAt']}

    ${instanceId}=  Set Variable  ${response['body']['speed'][0]['instanceId']}
    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_representation_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_representation_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}
    Check Response Status Code  204    ${response['status']}
    
    ${response}=  Get Temporal Representation Of Entity  ${temporal_entity_representation_id}    ${CONTENT_TYPE_LD_JSON}    sysAttrs
+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ ${status_code}= 400
016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present                  ${EMPTY}                                    speed                      ${valid_instanceId}
016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid                  ${temporal_entity_representation_id}        speed                      invalidId
016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present                ${temporal_entity_representation_id}        speed                      ${EMPTY}
016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name        ${temporal_entity_representation_id}        invalidId                  ${valid_instanceId}
016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name        ${temporal_entity_representation_id}        invalid(Id                 ${valid_instanceId}
016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present             ${temporal_entity_representation_id}        ${EMPTY}                   ${valid_instanceId}

*** Keywords ***
@@ -27,7 +27,7 @@ Partially Update Temporal Entity
    [Documentation]  Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right
    [Tags]  mandatory

    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_JSON}   ${ngsild_test_suite_context}
    Check Response Status Code  ${status_code}    ${response['status']}

    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
@@ -38,6 +38,6 @@ Create Id
    ${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}
    ${valid_instanceId}=  Set Variable  ${response['body']['speed'][0]['instanceId']}
    Set Suite Variable  ${valid_instanceId}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ Partially Update Temporal Entity
    [Documentation]  Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found
    [Tags]  mandatory

    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=  Partial Update Attribute From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${CONTENT_TYPE_JSON}   ${ngsild_test_suite_context}
    Check Response Status Code  ${status_code}    ${response['status']}

    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
@@ -37,6 +37,6 @@ Create Id
    ${unknown_temporal_entity_id}=     Generate Random Entity Id    ${vehicle_id_prefix}
    Set Suite Variable  ${unknown_temporal_entity_id}

    ${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}
    ${valid_instanceId}=  Set Variable  ${response['body']['speed'][0]['instanceId']}
    Set Suite Variable  ${valid_instanceId}
 No newline at end of file
+2 −10
Original line number Diff line number Diff line
{
   "speed":[
      {
         "type":"Property",
   "value":129,
   "observedAt":"2020-09-01T12:03:00Z"
}
 No newline at end of file
   ],
   "@context":[
      "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld"
   ]
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -346,8 +346,9 @@ Append Attribute To Temporal Entity Using Session
    [return]   ${response}

Partial Update Attribute From Temporal Entity
    [Arguments]  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${content_type}
    [Arguments]  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${fragment_filename}    ${content_type}      ${context}=${EMPTY}
    &{headers}=  Create Dictionary  Content-Type=${content_type}
    Run Keyword If     '${context}'!=''       Set To Dictionary   ${headers}   Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json"
    ${fragment_payload}=    Load Json From File    ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename}
    ${response}=  PATCH  ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId}  body=${fragment_payload}  headers=${headers}
    Output  request