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

fix(001_10): correct TC with numbering, keyword naming,...

parent 20773b70
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Test Teardown       Delete Initial Entity
Test Template       Create Entity Scenarios
Test Template       Create an entity with scopes


*** Variables ***
@@ -15,37 +15,38 @@ ${building_id_prefix}= urn:ngsi-ld:Building:


*** Test Cases ***    FILENAME    CONTENT_TYPE
001_01_01_EntityWithOneScope
    [Tags]    e-create    4_18
001_10_01 EntityWithOneScope
    building-minimal-with-one-scope.json    application/json
001_01_02_EntityWithManyScopes
    [Tags]    e-create    4_18
001_10_02 EntityWithManyScopes
    building-minimal-with-many-scopes.json    application/json


*** Keywords ***
Create Entity Scenarios
Create an entity with scopes
    [Documentation]    Check that you can create an entity with one or more scopes
    [Tags]    e-create    6_3_5    4_18
    [Arguments]    ${filename}    ${content_type}

    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Test Variable    ${entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${entity_id}
    ...    ${content_type}
    Set Test Variable    ${entity_id}

    Check Response Status Code    201    ${response.status_code}
    Check Response Headers Containing URI set to    ${entity_id}    ${response.headers}
    ${created_entity}=    Load Test Sample    entities/${filename}    ${entity_id}
    IF    '${content_type}'=='application/json'
        ${response}=    Retrieve Entity by Id    ${entity_id}    ${content_type}
        ${response1}=    Retrieve Entity by Id    ${entity_id}    ${content_type}
    END
    IF    '${content_type}'=='application/ld+json'
        ${response}=    Retrieve Entity by Id
        ${response1}=    Retrieve Entity by Id
        ...    ${entity_id}
        ...    ${content_type}
        ...    context=${ngsild_test_suite_context}
    END
    Check Created Resource Set To    ${created_entity}    ${response.json()}
    Check Created Resource Set To    ${created_entity}    ${response1.json()}

Delete Initial Entity
    Delete Entity by Id    ${entity_id}