019_03_05.robot 2.35 KB
Newer Older
root's avatar
root committed
*** Settings ***
Documentation       Check that you cannot query entitites if the request has a wrong geometryProperty

Resource            ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Teardown      Delete Entities


*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${filename}=                building-location-attribute-sample.jsonld
${entity_type}=             Building
${georel}=                  invalid
${geometry}=                Point
${coordinates}=             [-8.503,41.202]
${geoproperty}=             location
Query entitites when the request has a wrong geometryProperty
    [Documentation]    Check that you cannot query entitites if the request has a wrong geometryProperty
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
poujol's avatar
poujol committed
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
poujol's avatar
poujol committed
    Check Response Status Code    201    ${response.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
poujol's avatar
poujol committed
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
poujol's avatar
poujol committed
    Check Response Status Code    201    ${response.status_code}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${entity_type}
    ${response}=    Query Entities
    ...    entity_types=${entity_types_to_be_retrieved}
    ...    geoproperty=${geoproperty}
    ...    georel=${georel}
    ...    geometry=${geometry}
    ...    coordinates=${coordinates}
    ...    context=${ngsild_test_suite_context}
poujol's avatar
poujol committed
    Check Response Status Code    400    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
poujol's avatar
poujol committed
    ...    ${response.json()}
    ...    ${ERROR_TYPE_BAD_REQUEST_DATA}
poujol's avatar
poujol committed
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
root's avatar
root committed

*** Keywords ***
Delete Entities
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${second_entity_id}