Commit 4dd07760 authored by lopesg's avatar lopesg
Browse files

fixed 019_03_05 and 007_01_XX

parent 537c9970
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -6,9 +6,12 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${filename}=  building-minimal-sample.jsonld
${entity_type}=  https://ngsi-ld-test-suite/context#Building
${invalid_geometry_property}=  invalid_geometry_property
${filename}=  building-location-attribute-sample.jsonld
${entity_type}=  Building
${georel}=  invalid
${geometry}=  Point
${coordinates}=  [-8.503,41.202]
${geoproperty}=  location

*** Test Cases ***                                                 
Query entitites when the request has a wrong geometryProperty
@@ -23,7 +26,8 @@ Query entitites when the request has a wrong geometryProperty
    Check Response Status Code  201    ${response['status']}

    ${entity_types_to_be_retrieved}=  Catenate    SEPARATOR=,   ${entity_type}
    ${response}=    Query Entities    entity_types=${entity_types_to_be_retrieved}    geoproperty=${invalid_geometry_property}
    ${response}=    Query Entities    entity_types=${entity_types_to_be_retrieved}    geoproperty=${geoproperty}    georel=${georel}    geometry=${geometry}    coordinates=${coordinates}    context=${ngsild_test_suite_context}

    Check Response Status Code  400    ${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}
+3 −2
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ Create Temporal Entity
    Check Response Status Code  201    ${response['status']}

    ${created_temporal_entity}=    Load Test Sample    temporalEntities/${filename}      ${temporal_entity_representation_id}
    Set Test Variable  ${response}
    Check Created Resource Set To     ${created_temporal_entity}
    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}
    ${ignored_attributes}=  Create List    instanceId    @context
    Check Created Resource Set To     ${created_temporal_entity}    ${ignored_attributes}

    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
{
    "id": "urn:ngsi-ld:Building:randomUUID",
    "type": "Building",
    "name": {
        "type": "Property",
        "value": "Eiffel Tower"
    },
    "subCategory": {
        "type": "Property",
        "value": ["tourism"]
    },
    "geoQ":{
        "georel":"near;maxDistance==2000",
        "geometry":"Point",
        "coordinates":[-8.52,41.2],
        "geoproperty": "location"
    },
    "@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
+4 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ Query Entity
    [return]  ${request}    ${response}

Query Entities
    [Arguments]  ${entity_ids}=${EMPTY}     ${entity_types}=${EMPTY}     ${accept}=${EMPTY}    ${attrs}=${EMPTY}      ${context}=${EMPTY}    ${geoproperty}=${EMPTY}    ${options}=${EMPTY}     ${limit}=${EMPTY}    ${entity_id_pattern}=${EMPTY}
    [Arguments]  ${entity_ids}=${EMPTY}     ${entity_types}=${EMPTY}     ${accept}=${EMPTY}    ${attrs}=${EMPTY}      ${context}=${EMPTY}    ${geoproperty}=${EMPTY}    ${options}=${EMPTY}     ${limit}=${EMPTY}    ${entity_id_pattern}=${EMPTY}    ${georel}=${EMPTY}    ${coordinates}=${EMPTY}    ${geometry}=${EMPTY}
    ${attrs_length} =  Get Length  ${attrs}
    ${accept_length} =  Get Length  ${accept}
    ${options_length} =  Get Length  ${options}
@@ -85,6 +85,9 @@ Query Entities
    Run Keyword If     ${entity_types_length}>0       Set To Dictionary   ${params}    type=${entity_types}
    Run Keyword If     '${limit}'!=''       Set To Dictionary   ${params}    limit=${limit}
    Run Keyword If     '${entity_id_pattern}'!=''       Set To Dictionary   ${params}    idPattern=${entity_id_pattern}
    Run Keyword If     '${georel}'!=''       Set To Dictionary   ${params}    georel=${georel}
    Run Keyword If     '${coordinates}'!=''       Set To Dictionary   ${params}    coordinates=${coordinates}
    Run Keyword If     '${geometry}'!=''       Set To Dictionary   ${params}    geometry=${geometry}

    ${response}=  GET  ${ENTITIES_ENDPOINT_PATH}      headers=${headers}      query=${params}
    Output  request