Commit d6b6a4f8 authored by lopesg's avatar lopesg
Browse files

Merge branch 'develop' into fix/review-tests

parents 4b8610a2 7498807c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -13,9 +13,9 @@ ${status_code}= 204
${attribute_id}=  fuelLevel

*** Test Cases ***                                                                                         DELETEALL          DATASETID                                 EXPECTATION_FILE
015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID      false              ${EMPTY}                                  vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld
015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId      false              ${EMPTY}                                  vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld
015_01_02_Delete an attribute from a temporal representation of an entity with datasetId                   false              urn:ngsi-ld:Vehicle:12345-fuel            vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld
015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID         true               urn:ngsi-ld:Vehicle:12345-fuel            vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld
015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll                   true               ${EMPTY}                                  vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld

*** Keywords ***
Delete Attribute From A Temporal Entity
@@ -27,7 +27,7 @@ Delete Attribute From A Temporal Entity
    ${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}=  Delete Attribute From Temporal Entity  ${temporal_entity_representation_id}    ${attribute_id}     ${CONTENT_TYPE_LD_JSON}    ${datasetId}    ${deleteAll}
    ${response}=  Delete Attribute From Temporal Entity  ${temporal_entity_representation_id}    ${attribute_id}     ${CONTENT_TYPE_JSON}    ${datasetId}    ${deleteAll}   ${ngsild_test_suite_context}
    Check Response Status Code   ${status_code}    ${response['status']}

    ${temporal_entity_expectation_payload}=    Load Test Sample   temporalEntities/expectations/${expectation_filename}    ${temporal_entity_representation_id}
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld
*** Test Cases ***                                                                                         ENTITY_ID                           ATTRIBUTE_ID
015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id           ${EMPTY}                            speed
015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id          invalidId                           speed 
015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id       ${valid_temporal_entity_id}         invalidName
015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id       ${valid_temporal_entity_id}         invalid(Name

*** Keywords ***
Delete attribute from temporal entity with unknow entity/attribute id
@@ -28,7 +28,7 @@ Delete attribute from temporal entity with unknow entity/attribute id
    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
    Check Response Status Code   ${status_code}    ${response['status']}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to      ${response}     ${ERROR_TYPE_RESOURCE_NOT_FOUND}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
+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}
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ ${status_code}= 400
017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present                  ${EMPTY}                                    speed                      ${valid_instanceId}
017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid                  ${temporal_entity_representation_id}        speed                      invalidId                       
017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present                ${temporal_entity_representation_id}        speed                      ${EMPTY}                   
017_02_05_delete 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}
017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name        ${temporal_entity_representation_id}        invalid(Name               ${valid_instanceId}
017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present             ${temporal_entity_representation_id}        ${EMPTY}                   ${valid_instanceId}

*** Keywords ***
@@ -26,7 +26,7 @@ Delete attribute instance
    [Documentation]  Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right
    [Tags]  mandatory

    ${response}=  Delete Attribute Instance From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${CONTENT_TYPE_LD_JSON}
    ${response}=  Delete Attribute Instance From Temporal Entity  ${temporal_entity_id}    ${attributeId}    ${instanceId}    ${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
    ${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
Loading