Commit 8654de39 authored by lopesg's avatar lopesg
Browse files

fixed merge conflict

parents 839665ae 1a7b5a55
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -33,4 +33,7 @@ Batch Create Entity Scenarios
    Check Response Status Code Set To  201
    Check Response Body Containing Array Of URIs set to   @{expected_entities_ids}

    Query Entities    ${expected_entities_ids}  Building    context=${ngsild_test_suite_context}
    Check Created Resources Set To     ${entities_to_be_created}

    Batch Delete Entities       @{expected_entities_ids}
+4 −0
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ Create a batch of two valid entities and one invalid entity
    Check Response Status Code Set To  207
    Check Response Body Containing Batch Operation Result   ${expected_batch_operation_result}

    Query Entities    ${expected_successful_entities_ids}  Building    context=${ngsild_test_suite_context}
    @{created_entities}=  Create List   ${first_entity}     ${second_entity}
    Check Created Resources Set To     ${created_entities}

    @{entities_ids_to_be_deleted}=  Create List   ${first_entity_id}     ${second_entity_id}    ${existing_entity_id}
    Batch Delete Entities       @{entities_ids_to_be_deleted}

+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ Delete a batch of entities

    Check Response Status Code Set To  204

    Query Entities    ${entities_ids_to_be_deleted}  Building    context=${ngsild_test_suite_context}
    Check SUT Not Containing Resources

*** Keywords ***
Setup Initial Entities
    ${first_entity_id}=     Generate Random Entity Id    ${building_id_prefix}
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ Delete a batch of non existing and existing entities
    Check Response Status Code Set To  207
    Check Response Body Containing Batch Operation Result   ${expected_batch_operation_result}

    Query Entities    ${expected_successful_entities_ids}  Building    context=${ngsild_test_suite_context}
    Check SUT Not Containing Resources

*** Keywords ***
Setup Initial Entities
+18 −7
Original line number Diff line number Diff line
@@ -10,31 +10,42 @@ Suite Teardown Delete Initial Entities

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${entity_payload_filename}=  building-simple-attributes-sample.jsonld

*** Test Cases ***                        FILENAME
EntityWithSimpleProperties                building-simple-attributes-sample.jsonld
EntityWithSimpleRelationships             building-relationship-sample.jsonld
EntityWithRelationshipsProperties         building-relationship-of-property-sample.jsonld
*** Test Cases ***                        FILENAME                                          UPDATE_FRAGMENT_FILENAME
EntityWithSimpleProperties                building-simple-attributes-sample.jsonld          fragmentEntities/empty-fragment.json
EntityWithSimpleRelationships             building-relationship-sample.jsonld               fragmentEntities/locatedAt-fragment.json
EntityWithRelationshipsProperties         building-relationship-of-property-sample.jsonld   fragmentEntities/airQualityLevel-with-relationship-fragment.json

*** Keywords ***
Batch Update Entity Scenarios
    [Arguments]  ${filename}
    [Arguments]  ${filename}    ${update_fragment_filename}
    [Documentation]  Check that you can update a batch of entities
    [Tags]  mandatory

    ${first_entity}=    Load Entity    ${filename}      ${first_entity_id}
    ${second_entity}=    Load Entity    ${filename}      ${second_entity_id}
    @{entities_ids_to_be_updated}=  Create List   ${first_entity_id}     ${second_entity_id}
    @{entities_to_be_updated}=  Create List   ${first_entity}     ${second_entity}

    Batch Update Entities   @{entities_to_be_updated}

    Check Response Status Code Set To  204

    ${first_created_entity}=    Load Test Sample    entities/${entity_payload_filename}      ${first_entity_id}
    ${second_created_entity}=    Load Test Sample    entities/${entity_payload_filename}      ${second_entity_id}
    ${update_fragment}=    Load Test Sample    entities/${update_fragment_filename}
    ${first_updated_entity}=    Upsert Element In Entity     ${first_created_entity}    ${update_fragment}
    ${second_updated_entity}=    Upsert Element In Entity     ${second_created_entity}    ${update_fragment}
    @{updated_entities}=  Create List   ${first_updated_entity}     ${second_updated_entity}
    Query Entities    ${entities_ids_to_be_updated}  Building    context=${ngsild_test_suite_context}
    Check Updated Resources Set To   ${updated_entities}

Setup Initial Entities
    ${first_entity_id}=     Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=     Generate Random Entity Id    ${building_id_prefix}
    Create Entity  building-simple-attributes-sample.jsonld     ${first_entity_id}
    Create Entity  building-simple-attributes-sample.jsonld     ${second_entity_id}
    Create Entity  ${entity_payload_filename}     ${first_entity_id}
    Create Entity  ${entity_payload_filename}     ${second_entity_id}

    Set Suite Variable  ${first_entity_id}
    Set Suite Variable  ${second_entity_id}
Loading